XML: Use transforms when preparing data for signing
Each ds:Reference element may include an ordered list of ds:Transform elements, these describe how the signer obtained the data object that was digested. Transforms can include operations such as canonicalization, encoding/decoding, XPath and etc. The output of each Transform serves as input to the next Transform. The input to the first Transform is the result of dereferencing the URI attribute of the ds:Reference element. The output from the last Transform is the input for the DigestMethod algorithm.
To add the transform to the Reference:
Note: When transforms are applied the signer would not sign the native (original, referenced) document, but the resulting (transformed) document.