Refactor XHTML support.