Please, read the spec! The digest is calculated other data, signature signs the digests and all the related info in SignedInfo element. It's not as simple as "feed xml in signature (or digest) function and store result in the SignatureValue (DigestValue)". You have to apply transforms, do c14n when needed, etc. Aleksey