Content not allowed in prolog usually means the document does not start with <?xml etc.
Now for the real question - why in the world are you doing this convoluted business of reading with a Reader, building a String, and turning the String into a byte stream and then into a StreamSource.
You can turn a BufferedReader directly into an InputSource.
Bill
![](https://coderanch.com/images/smilies/jr-confused.gif)
[ October 15, 2006: Message edited by: William Brogden ]