private void fireEndEvents(final int from, final int to) throws SAXException {
        // Fire necessary end events.
        for (int i = from - 1; i >= to; i--) {
            final Event event = events[i];

            if (event.isStartElement()) {
                final StartElement elem = (StartElement) event;
                super.endElement(elem.getUri(), elem.getLocalName(), elem.getQName());

            } else if (event.isStartPrefixMapping()) {
                final StartPrefixMapping mapping = (StartPrefixMapping) event;
                super.endPrefixMapping(mapping.getPrefix());
            }
        }
    }
This method will fire character events if the current element depth is
greater than the split depth, i.e. no content is output for elements that
are lower in the element hierarchy than the split depth.

@param ch     An array of characters.
@param start  The starting position in the array.
@param length The number of characters to use from the array.
@throws org.xml.sax.SAXException The client may throw an exception during processing.
@see stroom.pipeline.filter.AbstractXMLFilter#characters(char[],
int, int)
stroom-pipeline/src/main/java/stroom/pipeline/filter/SplitFilter.java