You need to sign part of an XML document according the XML Signatures standard.
Use the classes in the System.Security.Cryptography.Xml namespace.
You can apply the hashing and signing techniques in recipe Encrypt an Object and Verify That Data Hasn’t Changed to encrypt XML content in a file or a byte array, just as you would create a hash for any other type of data. However, this approach introduces several limitations:
There’s no easy way to create a hash code and then make the resulting document (XML source and hash code) into a valid XML document.
Minor differences in XML documents (such as the addition of white space) will change the hash code, even though they have no effect on how the ...