title: create and download xml with button and domdocument
body: <p>well what i wnat to do is create a xml file and download it, if it is possible not saving in the server.</p>
  
  <p>what i have so far is creating the xml with DOMDocument and store it in the server </p>
  
  <pre><code>&lt;?php
  $domTree = new DOMDocument('1.0', 'UTF-8');
  $rootXML = $domTree-&gt;createElement( 'XML' );
  $rootXML = $domTree-&gt;appendChild($rootXML);
  
  $personalData = $domTree-&gt;createElement( 'PERSONAL' );
  $personalData = $rootXML-&gt;appendChild($personalData);
  $personalData -&gt;nodeValue = "Alan";
  $domTree-&gt;save('MyXmlFile.xml');
  ?&gt;
  </code></pre>
  
  <p>i know i supposed to use something like this</p>
  
  <pre><code>&lt;?php
  header('Content-type: text/xml');
  header('Content-Disposition: attachment; filename="text.xml"');
  
  echo $xml_contents;
  ?&gt;
  </code></pre>
  
  <p>but using DOMDocument im lost in hwo using it, THANKS IN ADVANCE!</p>