private void handleValueEndElement() throws SAXException {
        LOGGER.trace("End of value XML fragment");
        LOGGER.trace("================================================");
        insideValueElement = false;

        if (haveSeenXmlInValueElement) {
            // Complete the fastInfoSet serialisation to stagingValueOutputStream
            fastInfosetEndDocument();
            stagingValueOutputStream.setTypeId(FastInfosetValue.TYPE_ID);
        } else {
            // Simple string value
            final String value = content.toString();
            if (NullSafe.isBlankString(value)) {
                stagingValueOutputStream.setTypeId(NullValue.TYPE_ID);
            } else {
                try {
                    stagingValueOutputStream.setTypeId(StringValue.TYPE_ID);
                    stagingValueOutputStream.write(value);
                } catch (IOException e) {
                    throw new RuntimeException(LogUtil.message(
                            "Error writing string to stagingValueOutputStream: {}\n{}", e.getMessage(), value), e);
                }
            }
        }
    }
This method applies a post processing function if we are currently within
a function element. At this stage we should have details of the function
to apply from the corresponding start element and content to apply it to
from the characters event.

@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.
@throws org.xml.sax.SAXException The client may throw an exception during processing.
@see stroom.pipeline.filter.AbstractXMLFilter#endElement(java.lang.String,
java.lang.String, java.lang.String)
stroom-pipeline/src/main/java/stroom/pipeline/refdata/ReferenceDataFilter.java