XMLCipher xmlCipher = XMLCipher.getInstance(xmlCipherAlgorithm);
xmlCipher.init(XMLCipher.ENCRYPT_MODE, dataEncryptionkey);
if (secureTag.equalsIgnoreCase("")) {
embedKeyInfoInEncryptedData(document, keyCipher, xmlCipher, dataEncryptionkey);
document = xmlCipher.doFinal(document, document.getDocumentElement());
} else {
NodeIterator iter = XPathAPI.selectNodeIterator(document, secureTag);
Node node;
while ((node = iter.nextNode()) != null) {
embedKeyInfoInEncryptedData(document, keyCipher, xmlCipher, dataEncryptionkey);