setInnerHTML for XHTML documents

When running under XML mode, normalize the incoming HTML in setInnerHTML.
This looks rather slow. Perhaps we can generate XHTML-compatible markup from the start instead.