@Override
    public void startElement(final String uri,
                             final String localName,
                             final String qName,
                             final Attributes atts)
            throws SAXException {

        depthLevel++;
        insideElement = true;

        LOGGER.trace("startElement {} {} {}, level:{}", uri, localName, qName, depthLevel);

        if (VALUE_ELEMENT.equalsIgnoreCase(localName)) {
            insideValueElement = true;

            // Prepare to store new value.
            stagingValueOutputStream =
                    new ByteBufferPoolOutput(byteBufferFactory, BUFFER_OUTPUT_STREAM_INITIAL_CAPACITY, -1);
            saxDocumentSerializer.setOutputStream(stagingValueOutputStream);

        } else if (insideValueElement) {
            recordHavingSeenXmlContent();

            final String prefix = getPrefix(qName);
            if (!hasUriBeenApplied(prefix, uri)) {
                // elm has a uri that we have not done a fastInfoSet startPrefixMapping to
                // so do it now
                fastInfosetManuallyAddPrefixMapping(prefix, uri);
            }

            for (int i = 0; i < atts.getLength(); i++) {
                final String attrPrefix = getPrefix(atts.getQName(i));
                if (!hasUriBeenApplied(attrPrefix)) {
                    // attr has a uri that we have not done a fastInfoSet startPrefixMapping
                    // so do it now
                    final String attrUri = prefixToUriMap.get(attrPrefix);
                    if (attrUri != null) {
                        fastInfosetManuallyAddPrefixMapping(attrPrefix, attrUri);
                    }
                }
            }

            fastInfosetStartElement(localName, uri, qName, atts);

        } else if ("session".equals(localName) ||
                   "session-start".equals(localName) ||
                   "session-end".equals(localName)) {
            start = true;
            time = null;
            timeout = null;

            if ("session-end".equals(localName)) {
                start = false;
            }
        }

        content.clear();
        super.startElement(uri, localName, qName, atts);
    }
This method looks for a post processing function. If it finds one it does
not output the element. Instead it stores data about the function and
sets a flag so that the function can be performed when the corresponding
end element is reached.

@param uri       The element's Namespace URI, or the empty string.
@param localName The element's local name, or the empty string.
@param qName     The element's qualified (prefixed) name, or the empty string.
@param atts      The element's attributes.
@throws SAXException The client may throw an exception during processing.
@see stroom.pipeline.filter.AbstractXMLFilter#startElement(String,
String, String, Attributes)
stroom-state/stroom-state-impl/src/main/java/stroom/state/impl/pipeline/StateFilter.java