@Override
    public void endProcessing() {
        try {
            if (started) {
                // End root element.
                if (root != null) {
                    System.out.println("ending root element: " + root.getLocalName());
                    super.endElement(root.getUri(), root.getLocalName(), root.getQName());
                }

                // End stored prefix mappings.
                while (!prefixDeque.isEmpty()) {
                    final StartPrefixMapping prefixMapping = prefixDeque.pop();
                    super.endPrefixMapping(prefixMapping.getPrefix());
                }
                // End the document.
                super.endDocument();
            }
        } catch (final SAXException e) {
            throw ProcessException.wrap(e);
        } finally {
            super.endProcessing();
        }
    }
Called by the pipeline when processing of a file is complete.

@see stroom.pipeline.filter.AbstractXMLFilter#endProcessing()
stroom-pipeline/src/main/java/stroom/pipeline/filter/MergeFilter.java