public static XMPMeta convert(Metadata tikaMetadata, String mimetype) throws TikaException {
        if (tikaMetadata == null) {
            throw new IllegalArgumentException("Metadata parameter must not be null");
        }

        ITikaToXMPConverter converter = null;

        if (isConverterAvailable(mimetype)) {
            converter = getConverter(mimetype);
        } else {
            converter = new GenericConverter();
        }

        XMPMeta xmp = null;

        if (converter != null) {
            try {
                xmp = converter.process(tikaMetadata);
            } catch (XMPException e) {
                throw new TikaException("Tika metadata could not be converted to XMP", e);
            }
        } else {
            xmp = XMPMetaFactory.create(); // empty packet
        }

        return xmp;
    }
Convert the given Tika metadata map to XMP object. If a mimetype is provided in the Metadata
map, a specific converter can be used, that converts all available metadata. If there is no
mimetype provided or no specific converter available a generic conversion is done which will
convert only those properties that are in known namespaces and are using the correct
prefixes.

@param tikaMetadata the Metadata map from Tika
@param mimetype     depicts the format's converter to use
@return XMP object
@throws TikaException
tika-xmp/src/main/java/org/apache/tika/xmp/convert/TikaToXMP.java