@Override
    public void endDocument() throws SAXException {
        for (int i = 0; i < filters.length; i++) {
            try {
                final XMLFilter filter = filters[i];
                filter.endDocument();
            } catch (final RuntimeException e1) {
                LOGGER.trace("Unable to end document!", e1);

                // Make sure the rest of the filters get the event.
                for (i = i + 1; i < filters.length; i++) {
                    final XMLFilter f = filters[i];
                    try {
                        f.endDocument();
                    } catch (final RuntimeException e2) {
                        LOGGER.trace("Unable to end document!", e2);
                    }
                }

                throw ProcessException.wrap(e1);
            }
        }
    }
Receive notification of the end of a document.
<p>
<p>
<strong>There is an apparent contradiction between the documentation for
this method and the documentation for
{@link org.xml.sax.ErrorHandler#fatalError}. Until this ambiguity is
resolved in a future major release, clients should make no assumptions
about whether endDocument() will or will not be invoked when the parser
has reported a fatalError() or thrown an exception.</strong>
</p>
<p>
<p>
The SAX parser will invoke this method only once, and it will be the last
method invoked during the parse. The parser shall not invoke this method
until it has either abandoned parsing (because of an unrecoverable error)
or reached the end of input.
</p>

@throws org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
@see #startDocument
stroom-pipeline/src/main/java/stroom/pipeline/filter/XMLFilterFork.java