XMLCipher kwCipher = XMLCipher.getInstance();
kwCipher.init(XMLCipher.UNWRAP_MODE, keyWrappingKey);
KeyInfo ki = encryptedData.getKeyInfo();
EncryptedKey encryptedKey = ki.itemEncryptedKey(0);
Key symmetricKey =
kwCipher.decryptKey(
encryptedKey, encryptedData.getEncryptionMethod().getAlgorithm()
);
cipher.init(XMLCipher.DECRYPT_MODE, symmetricKey);
return cipher.doFinal(document, ee);