innerXHTML is a glorified DOM read/writer. innerXHTML reads the document node tree, returning a text string of markup to the document's equivalent. Issues related with this can be tagged with [innerXHTML] .
innerHTML utilises existing functionality, all supported by the W3C, to read and write to the DOM. In doing so, innerXHTML gains all the benefits of innerHTML without the baggage; speed and ease of use, whilst keeping within the boundaries of global standardisation.
innerXHTML is not a document copier; it does not fetch exactly what the document contains, character for character in a zombie-like fashion
Sample
var container = document.getElementById('container');
var code = innerXHTML(container);
Source: