I’m sticking with XSL, XML and DOM, so I’m trying to free myself of strings. I had a tough time dropping disable-output-escaping, as I first tried xsl:copy-of, which resulted in an empty xmlns attribute in xhtml docs.

I finally remembered that the nodes just have to be rebuilt, either using xsl:element or the new elements entirely. Now to try and keep things flexible, I’ll need to craft up some xsl:templates for common html elements. So far I’ve got script and link, but of course I’ll need a whole bunch more than that.

Also, attribute sets!

Hah, well its actually not that difficult. All that was needed was an identity transform which avoids copy and copy-of. Thanks to Ben, its really quite simple!