title: XML parsing in php not working?
body: <p>I thought that I was properly creating an xml document in my php script from a mysql query, but I am not getting an xml document in return (with no php errors to help me) even though the mysql query works!</p>
  
  <pre><code>    &lt;?php
      ...
      $result = $mysqli-&gt;query($sql);
      if ($result) {       //this query works, but no xml document produced as a result
      $d = new DOMDocument();
      $books = $d-&gt;createElement('hey');
      $hey-&gt;setAttribute('check','The Adventures of Tom Sawyer');
      $d-&gt;appendChild($books);
      $d-&gt;appendChild($hey);
      $d-&gt;appendChild($books);
      echo $d-&gt;saveXML();
  }
      ?&gt;
  </code></pre>