@Override
    public void endDocument() throws SAXException {
        if (startedDocument) {
            try {
                handler.endDocument();

                if (builder != null) {
                    // Store the current root.
                    root = builder.getCurrentRoot();
                }

                reset();
            } finally {
                startedDocument = false;
                super.endDocument();
            }
        }
    }
Buffers a endDocument event if buffer is set to true.

@see stroom.pipeline.filter.AbstractXMLFilter#endDocument()
stroom-pipeline/src/main/java/stroom/pipeline/filter/TinyTreeBufferFilter.java