To serialize a document using SAX events, create a compatible serializer using Serializer.makeSAXSerializer and pass it around as a DocumentHandler .