I usually validate my XML's by loading the document to parse via xmldoc->load(path). Then you check for errors with
xmldoc->get_parseError(errorObject). You get errorstring, line, character pos, etc.
Please let me know if it worked!

Dan