Why do convert it into HTML when your using the XML Libraries.
If you do that you should use
XML - Which holds the data from the Database
XSL - To Format the why you want the data to be displayed
Then eventually show it in XHTML. Basically the same as HTML just requires a DOC type, Meta Tag, Head and good formatting of code. If you do that for HTML know you shouldnt have any troubles with XHTML.