title: Javascript can't interpret returned xml
body: <p>Seems my javascript isn't picking up on my php sending back an xml document. php code:</p>
  
  <pre><code>$domtree = new DOMDocument('1.0', 'UTF-8');
  
  /* append it to the document created */
  $xmlRoot = $domtree-&gt;appendChild($domtree-&gt;createElement("root"));
  
  foreach (glob('./img/photos/*.*') as $filename) {
      //echo $filename;
      $xmlRoot-&gt;appendChild($domtree-&gt;createElement("image",$filename));
  }
  
  /* get the xml printed */
  echo $domtree-&gt;saveXML();
  </code></pre>
  
  <p>The output of the code above is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;root&gt;&lt;image&gt;./img/photos/2012-02-26 17.02.12.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-03-09 08.21.48.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-07-21 14.09.39.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-07-25 15.25.17.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-08-04 17.54.38.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-08-04 23.36.30.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-08-06 06.08.43.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-08-07 20.57.34.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-08-09 20.40.11.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-08-25 20.54.05.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-09-07 11.19.50.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2012-09-08 15.53.27.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2013-01-30 19.19.16.jpg&lt;/image&gt;
  &lt;image&gt;./img/photos/2013-01-31 09.48.39.jpg&lt;/image&gt;&lt;/root&gt;
  </code></pre>
  
  <p>Calling this with AJAX, when I call AJAXRequest.responseXML i get null back.</p>
  
  <p>EDIT: AJAX Request Code:</p>
  
  <pre><code>function requestImages()
  {
      request=new XMLHttpRequest();
      request.open("GET", "getPhotos.php");
      request.onreadystatechange=showPhotos;
      request.send();
  }
  
  function showPhotos()
  {
      if ((request.readyState == 4)) {
          doc=request.responseXML; // This returns null
      }
  }
  </code></pre>