This should do it for you:
Basically, instead of creating your StreamResult with a FileOutputStream,
you should be using a ByteArrayOutputStream and then using the toString() method on the ByteArrayOutputStream.
[ August 04, 2005: Message edited by: DW Bolton ]