title: Loading XML into the DOM and replacing usage of Microsoft.XMLDOM
body: <p>I'm working with a some legacy code and in many places there's code to get XML data from some url. it's pretty straight forward.</p>
  
  <pre><code>var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async="false";           
  xmlDoc.load(url);
  </code></pre>
  
  <p>and in some places</p>
  
  <pre><code>var httpRequest= new ActiveXObject("Msxml2.XMLHTTP.6.0");
  httpRequest.open('GET', url, false);
  httpRequest.send(null);
  </code></pre>
  
  <p>in most cases we're picking results from response XML. 
  I've seen in a number of places that the usage of "Microsoft.XMLDOM" is antiquated, replacing it in favor of ActiveXObject("Msxml2.XMLHTTP.6.0").
  For other browsers I should use the standard W3C XMLHttpRequest. This seems to work without any problems. </p>
  
  <p><strong>The problem is loading the result xml string. 
  I see that loadXML is defined when using "Microsoft.XMLDOM" but not with ActiveXObject("Microsoft.XMLHTTP");</strong> </p>
  
  <p>With other browsers DOMParser is the suggested method as well as IE-11.</p>
  
  <p>This is what I did to retrieve information from a url then 
  parse that information and then finally attempt to load the XML string to the DOM. 
  My main problem is I'm getting more and more confused as to what solution is appropriate when Manipulating XML with regards to Internet Explorer or maybe it's just too late in the day.
  <em>I wanted to remove the usage of "Microsoft.XMLDOM" but to perform the loadXML I had to go back to it. is there a better way to approach this?</em></p>
  
  <pre><code> // Get the information use either the XMLHttpRequest or ActiveXObject
   if (window.ActiveXObject || 'ActiveXObject' in window) {
          httpRequest = new ActiveXObject("Msxml2.XMLHTTP.6.0");
          }
          else if (window.XMLHttpRequest) {
              httpRequest = new XMLHttpRequest();
              if (httpRequest.overrideMimeType) {
                  httpRequest.overrideMimeType('text/xml');
      }
  }
  
  httpRequest.open('GET', url, false);
  httpRequest.send();
  
  var xmlDoc = httpRequest.responseXML;
  
  // Retrieve the XML into the DOM
  var xml = xmlDoc.getElementsByTagName("XML_STRING_SETTINGS")
  
  
  // Load the XML string into the DOM
  if (window.DOMParser) {
      var parser = new DOMParser();
      xmlDoc = parser.parseFromString(xml, "text/xml");
  }
  else // code for IE
  {
      xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async = false;
      // is there another way to do this load? 
      xmlDoc.loadXML(xml);
  }
  </code></pre>