protected void addMetadata(String value) {
        if (value != null && value.length() > 0) {
            if (metadata.isMultiValued(name)) {
                // Add the value, assuming it's not already there
                List<String> previous = Arrays.asList(metadata.getValues(name));
                if (!previous.contains(value)) {
                    if (property != null) {
                        metadata.add(property, value);
                    } else {
                        metadata.add(name, value);
                    }
                }
            } else {
                // Set the value, assuming it's not already there
                String previous = metadata.get(name);
                if (previous != null && previous.length() > 0) {
                    if (!previous.equals(value)) {
                        if (property != null) {
                            if (property.isMultiValuePermitted()) {
                                metadata.add(property, value);
                            } else {
                                // Replace the existing value if isMultiValuePermitted is false
                                metadata.set(property, value);
                            }
                        } else {
                            metadata.add(name, value);
                        }
                    }
                } else {
                    if (property != null) {
                        metadata.set(property, value);
                    } else {
                        metadata.set(name, value);
                    }
                }
            }
        }
    }
Adds the given metadata value. The value is ignored if it is
<code>null</code> or empty. If the metadata entry already exists,
then the given value is appended to it with a comma as the separator.

@param value metadata value
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-xml-module/src/main/java/org/apache/tika/parser/xml/AbstractMetadataHandler.java