title: How do I get HTML corresponding to current DOM tree?
body: <p>jQuery("html").html() seems to retrieves most of it, except for the wrapping  tag.</p>
  
  <p>DOM is heavily modified, so original source is of not that much use.</p>
  
  <ul>
  <li>Is it reliable?</li>
  <li>Is it a good idea to just take jQuery's output and wrap ... around it? I can see at least some doctype problems here, and inclusion of scripts which shouldn't be rerun.</li>
  <li>Any better way?</li>
  </ul>
  
  <p>EDIT: jQuery("").append(jQuery("html").clone()).html() almost works, except for doctype. Is there an easy way to get it?</p>
  
  <p>EDIT 2: I need the doctype mostly to get proper quirk/almoststandards/standards mode. document.compatMode has half of it, is it enough?</p>