if (decryptedNode != null
&& decryptedNode.getParentNode().getLocalName().equals(WSConstants.ENCRYPED_ASSERTION_LN)
&& decryptedNode.getParentNode().getNamespaceURI().equals(WSConstants.SAML2_NS)) {
Node soapHeader = decryptedNode.getParentNode().getParentNode();
soapHeader.replaceChild(decryptedNode, decryptedNode.getParentNode());
}
WSSecurityEngineResult result =
new WSSecurityEngineResult(WSConstants.ENCR, Collections.singletonList(dataRef));
result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));