Good afternoon, I use XMLSEC with OPENSSL to digitally sign XML documents generated by users in an application. The application uses the enveloped structure of digital signature as described by W3C. Once they are signed the message is sent to a Server that adds a reference to a Stylesheet and resends the message to the final recipient. To sum up: Generate XML -> Digital Signature Enveloped -> Send to a server -> Add a reference to a Stylesheet -> Resend to the receipient -> Digital Signature Validation -> FAILS!!!! <?xml version="1.0" encoding="ISO-8859-1" ?> <?xml-stylesheet type="text/xsl" href="xsl-file.xsl" ?> <Data> <tag1>....</tag1> <tag2>....</tag2> <tag3>....</tag3> <tag4>....</tag4> <tag5>....</tag5> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">