@Override
    public void endElement(String uri, String localName, String name) {
        if (isMatchingParentElement(uri, localName)) {
            parentMatchLevel--;
        }
        if (isMatchingElement(uri, localName)) {
            matchLevel--;
            if (matchLevel == 2) {
                // we're inside a bag li element, add the bagged buffer
                addMetadata(bufferBagged.toString().trim());
                bufferBagged.setLength(0);
                isBagless = false;
            }
            if (matchLevel == 0 && isBagless) {
                String valueBagless = bufferBagless.toString();
                if (valueBagless.length() > 0 && !valueBagless.contains(LOCAL_NAME_RDF_BAG)) {
                    // we're in a standard element, add the bagless buffer
                    addMetadata(valueBagless.trim());
                    bufferBagless.setLength(0);
                }
                isBagless = true;
            }
        }
    }
Constructor for Property metadata keys which allows change of behavior
for duplicate and empty entry values.

@param uri                  the uri of the namespace of the element
@param localName            the local name of the element
@param metadata             the Tika metadata object to populate
@param targetProperty       the Tika metadata Property key
@param allowDuplicateValues add duplicate values to the Tika metadata
@param allowEmptyValues     add empty values to the Tika metadata
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-xml-module/src/main/java/org/apache/tika/parser/xml/ElementMetadataHandler.java