public String getXmpXml(ByteSource byteSource, Map params)
            throws ImageReadException, IOException
    {

        List chunks = readChunks(byteSource, new int[] { iTXt, }, false);

        if ((chunks == null) || (chunks.size() < 1))
            return null;

        List xmpChunks = new ArrayList();
        for (int i = 0; i < chunks.size(); i++)
        {
            PNGChunkiTXt chunk = (PNGChunkiTXt) chunks.get(i);
            if (!chunk.getKeyword().equals(XMP_KEYWORD))
                continue;
            xmpChunks.add(chunk);
        }

        if (xmpChunks.size() < 1)
            return null;
        if (xmpChunks.size() > 1)
            throw new ImageReadException(
                    "PNG contains more than one XMP chunk.");

        PNGChunkiTXt chunk = (PNGChunkiTXt) xmpChunks.get(0);
        return chunk.getText();
    }