title: AJAX: responseXML is null in IE 11
body: <p>An AJAX call using the script below is failing on IE 11. It works on earlier versions of IE - 6 definitely (this is old code), 7, 8, and 9 suspected. It works on Firefox 32.0.1, and probably as far back as 2 (this is very old code).</p>
  
  <p>The script errors at <code>objXML = req.responseXML.documentElement;</code> with the error "Unable to get property 'documentElement' of undefined or null reference.".</p>
  
  <p>On debugging, req.responseXML is null, while req.responseText has the expected XML. Searching for this problem, the solutions centre around the response type not being 'text/xml', but the debugger shows that the response type is the correct 'text/xml'.</p>
  
  <p>Why is req.responseXML null?</p>
  
  <pre><code>var req;
  
  function loadXMLDoc(url) 
  {
      // branch for native XMLHttpRequest object
      if (window.XMLHttpRequest) {
          req = new XMLHttpRequest();
          req.onreadystatechange = processReqChange;
          req.open("GET", url, true);
          req.send(null);
      // branch for IE/Windows ActiveX version
      } else if (window.ActiveXObject) {
          req = new ActiveXObject("Microsoft.XMLHTTP");
          if (req) {
              req.onreadystatechange = processReqChange;
              req.open("GET", url, true);
              req.send();
          };
      };
  };
  
  function processReqChange() 
  {
      // only if req shows "complete"
      if (req.readyState == 4) {
          // only if "OK"
          if (req.status == 200) {
              // ...processing statements go here...
              //alert(req.responseText);
  
              objXML = req.responseXML.documentElement;
  
              // snip... using response data...
  
          } else {
              alert("There was a problem retrieving the XML data:\n\n" + req.statusText);
              alert(req.status + "\n\n" + req.responseText);
          };
      };
  };
  </code></pre>