Error during transformation from XML to HTML

Hi All,
I have a requirement where the document needs to be converted to an XML string and then using the style sheet convert it to an html file. I am using the service pub.xslt.Transformations.transformSerialXML to do this task. When executing this service getting the following error:

[B2BXSL.0002.9003] JAXP: Error during transformation - com.wm.pkg.xslt.util.LocalizedTransformerException: [B2BXSL.0002.9001] JAXP: Fatal Error - The markup in the document following the root element must be well-formed.; SystemID: ; Line#: 81; Column#: 2
If anyone of you have faced a similar situation,please put on your views on this.

I got this resolved and wanted to update this. Actually the document i am converting to an XML string is a published canonical document which has variable associated with it which in turn has special charcters within it. These special charcters are not handled by the transformSerialXML service. Then, i dropped the variable from the canonical document and now its working fine.