Changes to decouple XML output from XHTML output; note that in this commit the source HTML's doctype and XHTML namespace still override configuration flags in code