title: Extract the current DOM and print it as a string, with styles intact
body: <p>I'd like to be able to take my DOM, as is, and convert it to a string.  Let's say I open up the inspector and make a change to the margin-left property of a particular element.  That change should be reflected in my string.</p>
  
  <p>The function should properly take all the styles currently applied to an element (excluding default values) and include them in the inline style for that element.</p>
  
  <p>I have written a 'solution' which has proven to be inadequate.  The <code>getMatchedCSSRules</code> function in webkit is extremely finicky, and I haven't been able to determine why it sometimes works and doesn't work other times.  Therefore, I would like to avoid using this function unless it works 100% of the time.  Similarly, the <code>getComputedStyle</code> function has problems of its own.  If use the inspector to change the #footer element on this page to be <code>7px solid red</code> rather than <code>7px solid black</code>, the change will be reflected in when I run <code>getComputedStyle(document.getElementById('footer')).cssText</code> in the console, but it will also give me a host of inherited properties that were never modified by either the user using the inspector or by the stylesheets on the page.</p>
  
  <p>I am looking for a solution that works with webkit--cross browser compatibility is not an issue at the moment. </p>
  
  <p>Thank you!</p>