Have you tried printing the content of the stream to make sure that what's being retrieved is, in fact, a well-formed XML document?
(For what it's worth, that error message is actually coming from Xerces, before Xalan per se sees the document's content.)
