title: Ajax: responseXML returning null
body: <p>Reading a beginners book for Ajax and the second example is getting XMl data from a php file. I've been stuck for about 2 hours now googling and reading this site's answers to other people's similar problems and I can't figure it out</p>
  
  <p>my function</p>
  
  <pre><code>var options;
  
  function getOptions1(){
      var XMLHttpRequestObject = new XMLHttpRequest();
      XMLHttpRequestObject.open("GET", "http://localhost/AV/data.php", false); // this was "true" somewhere i read to set it to "false"
      XMLHttpRequestObject.onreadystatechange = function(){
          if (this.readyState != 4) return;
          if (this.status == 200){ 
              alert ("hi");
              var xmlDocument = this.responseXML;
              options = xmlDocument.getElementsByTagName("option"); // firefox tels me here "TypeError xmlDocument is null"
              listOptions();
          }
      }
      XMLHttpRequestObject.send(null);
  }
  </code></pre>
  
  <p>and here's the data.php file</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8" ?&gt; //i read to add that encoding in there - no help
      &lt;options&gt;
          &lt;option&gt;red&lt;/option&gt;
          &lt;option&gt;green&lt;/option&gt;
          &lt;option&gt;blue&lt;/option&gt;
      &lt;/options&gt;
  </code></pre>