Discuss this help topic in SecureBlackbox Forum
Encrypt the XML node
First you need to specify, what exactly you will encrypt. XMLEnc standard lets you encrypt the element itself or it's contents. You choose what you encrypt by setting EncryptedDataType property to either xedtElement or xedtContent.
Next, call Encrypt() method of TElXMLEncryptor class and pass the node to be encrypted ("ANode").
Call Save() method of TElXMLEncryptor class. The method will return the node, which contains the encrypted data ("AnEncryptedNode").
If you are encrypting the element, then you need to replace the node you encrypted with the resulting node. This is done by calling ReplaceChild() method as follows: ANode.ParentNode.ReplaceChild(AnEncryptedNode, ANode).
If you are encrypting the element contents, then you need to remove all children nodes of the node you encrypted.
After that add the encrypted node as a single child.
Example (C# synthax):
while (ANode.LastChild != null)
ANode.RemoveChild(ANode.LastChild);
ANode.AppendNode(AnEncryptedNode);