title: Generate XML file with Customized XML tags out of oracle database table
body: <p>I am working on oracle database 9ir2
  I need to convert some tables into xml files with custom format tags.</p>
  
  <p>for example:
  I want to generate XML from some columns in emp table then generate a file with name "myxmlfile.xml" as following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;entity-engine-xml&gt;
   &lt;myxmlfile
    EMPNO="8401"
    ENAME="JHON"
    HIREDATE="1988-12-30"
    SAL="5000"
    DEPTNO="10"
  
   /&gt;
   &lt;myxmlfile
      ...
   /&gt;
   &lt;myxmlfile
      ...
   /&gt;
  &lt;/entity-engine-xml&gt;
  </code></pre>
  
  <ol>
  <li>how to generate custom XML file with tags as above, and everytime the user need to do so, in other words "per user request" by using pl/sql, how to use oracle XML functions to output customized desired tags?.</li>
  <li>how to convert xmltype to varchar2 ??? ... to_char() function is unable to convert XMLtype to char.</li>
  <li>what is the easiest way to create XML file on client side ?</li>
  </ol>
  
  <p>note: the user application is running on XP PCs, built by old oracle developer tools forms6i.</p>