Note that the XSLT processor formats the results of applying the stylesheet. If your stylesheet generates XML or HTML that does not follow all syntax rules, the XSLT processor does not do anything to fix this. For example, if a stylesheet generates multiple root elements, the XSLT processor neither fixes this nor generates an error. You receive a string, and it is only upon examination or use of the string that you would learn that it is not well-formed XML.