I have an java class that stores XML data using the org.w3c.dom classes. I've given it a .writeXML(java.io.Writer) method to write its data (using org.apache.xml.serialize.XMLSerializer). The problem comes when I want to pass this data to an XSLT transformer, which needs a StreamSource (created with a Reader, not a Writer obviously). What I tried (and failed) to do was use a PipedReader and PipedWriter, linked together. The XML data would be written to the PipedWriter, I'd call .close() on it, and the data would then be available to the PipedReader and thus the transoformer. The problem is that PipedReaders/Writers weren't meant to be used this way, and there is a 1k buffer limit that I cannot get around. In other words, this technique works so long as the amount of XML data is under 1k. But that isn't acceptable. I was thinking that this must surely be a common problem, and surely someone has found a way to accomplish this. Any help would be greatly appreciated.