title: XMLHttpRequest throws error responseXML = null, but content appears anyway
body: <p>This is my first XMLHttpRequest attempt, and while it works (the content is loaded from the xml file, and displays correctly in the browser), Mozilla Console shows the error:</p>
  
  <pre><code>[15:05:54.147] TypeError: xmlTree is null @ http://127.0.0.1/scripts/firstExternal.js:37
  </code></pre>
  
  <p>I don't know how it can be null, if the content loads?</p>
  
  <p>Here is the function, called from the window.onload event:</p>
  
  <pre><code>function getXML() {
      if (window.XMLHttpRequest) {
          var xhr = new XMLHttpRequest();
          xhr.onreadystatechange = (function () {
              if (xhr.readyState = 4) {
                  if (xhr.status = 200) {
                      var xmlTree = xhr.responseXML;
                      var container = document.getElementById("container");
  error here:         var textList = xmlTree.getElementsByTagName("text");
                      for (var i = 0; i&lt;textList.length; i++) {
                          var tempText = document.createTextNode(textList[i].textContent);
                          var tempElem = document.createElement("P");
                          tempElem.appendChild(tempText);
                          container.appendChild(tempElem);
                      }
                  } else {
                      document.getElementById("container").innerHTML = xhr.status + " - " + xhr.statusText;
                  }
              }
          });
          xhr.open("GET","/res/sample.xml",true);
          xhr.send();
      }
  }
  </code></pre>
  
  <p>and the XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xml&gt;
      &lt;text&gt;This is a sentence.&lt;/text&gt;
      &lt;text&gt;This is the second sentence.&lt;/text&gt;
      &lt;text&gt;ain't one.&lt;/text&gt;
      &lt;text&gt;More bric a brac&lt;/text&gt;
      &lt;text&gt;Foo, bar, baz.  Fizzbuzz forever.&lt;/text&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>EDIT:
  The response header:</p>
  
  <pre><code>Date: Sat, 01 Feb 2014 23:31:03 GMT Server: Apache/2.2.22 (Ubuntu) Last-Modified: Sat, 01 Feb 2014 23:28:47 GMT Etag: "21d16-ed-4f160a6f67bb5" Accept-Ranges: bytes Content-Length: 237 Content-Type: application/xml
  </code></pre>