title: How to prevent double quotes being removed from outerHTML/innerHTML?
body: <p>I have some Javascript in a legacy page I'm working with that reads the entire HTML of a page so that it can be saved to a file:</p>
  
  <pre><code>html = document.documentElement.outerHTML;
  </code></pre>
  
  <p>However this and the <code>innerHTML</code> alternative both strip off the double quotes around some attribute values resulting in HTML that I can't use for later processing.</p>
  
  <p>e.g. </p>
  
  <pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
  </code></pre>
  
  <p>becomes </p>
  
  <pre><code>&lt;META content="text/html; charset=utf-8" http-equiv=Content-Type&gt;
  </code></pre>
  
  <p>When I 'View Source' the quotes are correct so how can I get the correct HTML with Javascript? My development environment is Visual Studio 2013 and Internet Explorer 10 (in quirks mode) in case that's relevant.</p>
  
  <p>Clarification: The first step of the later processing is to load the HTML into an XMLDocument. The problem is that this fails because of the missing double quotes.</p>