public static String getXmpXml(final ByteSource byteSource) throws ImagingException, IOException {
        final AbstractImageParser<?> imageParser = ImageParserFactory.getImageParser(byteSource);
        if (imageParser instanceof XmpEmbeddable) {
            return ((XmpEmbeddable<?>) imageParser).getXmpXml(byteSource, null);
        }
        return null;
    }
Extracts the embedded XML metadata as an XML string.

@param byteSource File containing image data.
@return Xmp Xml as String, if present. Otherwise, returns null.
@throws ImagingException if it fails to parse the image
@throws IOException      if it fails to read the image data
src/main/java/org/apache/commons/imaging/Imaging.java