Though job. The lazy way would be to use a PipeStream to pipe the content written to the PrintWriter to a SAX parser running in another thread. That's likely to course trouble in some circumstances.
I don't see anything lazy about this :)
IMHO, lazy way is to use StringWriter and then parse resulting text with SAX parser using one of the Cocoon's Util classes.
I always thought I was lazy. But then: >> running in another thread. That's likely to course trouble ^^^^^^ I thought I even spell-checked the message before sending!
J.Pietschmann