setInnerHTML for XHTML documents

When running under XML mode, normalize the incoming HTML in setInnerHTML.
At a glance the whole thing seems pretty reasonable, but I haven't looked closely.

The first things that jumps out at me here is that we should pull these regexs out to constants to dedupe (and to only create them once).