If it says that your XML is invalid then it is almost certainly right. Your first step should be to investigate the XML with tools that give you rather better diagnostics than this!
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference