title: Saving a table to an XML file
body: <p>I am currently working on a website. I have been asked to be able to allow admins to save tables in the database to an XML file (so they can download it from their browser).</p>
  
  <p>I don't even know where to begin. I've done multiple hours of research but this process doesn't seem very well documented. I would appreciate some pointers in the right direction, or if possible, a more in-depth explanation. </p>
  
  <p>How would I set-up my files? How can I make them download that file instead of saving it into my application? How would I even save it to an XML file to start?</p>
  
  <p>I've seen some stuff online about backing your database into an XML file, but I feel that this is different as it allows users to download a database file instead of the developer making one.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>For clarity's sake the XML should resemble the database.
  So, if I have a Product (or products), I would hope the XML looks something similar to the following:</p>
  
  <pre><code>&lt;product&gt;
       &lt;title&gt;
            My Product
       &lt;/title&gt;
       &lt;price&gt;
            5.00
       &lt;/price&gt;
       &lt;quantity&gt;
            4
       &lt;/quantity&gt;
       &lt;description&gt;
            This is my product!
       &lt;/description&gt;
  &lt;/product&gt;
  </code></pre>