<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Envelope [
  <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
  <!ENTITY c14n 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>
  <!ENTITY xpath 'http://www.w3.org/TR/1999/REC-xpath-19991116'>
  <!ENTITY xslt 'http://www.w3.org/TR/1999/REC-xslt-19991116'>
  <!ATTLIST Notaries Id ID #IMPLIED>
]>
<!-- Preamble -->
<Envelope xmlns:foo="http://example.org/foo" xmlns="http://example.org/usps">
  <DearSir>foo</DearSir>
  <Body>bar</Body>
  <YoursSincerely>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signature">
      <SignedInfo>
        <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
        <Reference URI="http://www.w3.org/TR/xml-stylesheet">
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference URI="http://www.w3.org/Signature/2002/04/xml-stylesheet.b64">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-1">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
              <XPath>
                self::text()
              </XPath>
            </Transform>
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-2">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest-1">
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#signature-properties-1">
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference URI="">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference URI="">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference URI="#xpointer(/)">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference URI="#xpointer(/)">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Id="reference-1" URI="#manifest-reference-1">
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Id="reference-2" URI="#reference-1">
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference URI="#reference-2">
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
              <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
                ancestor-or-self::dsig:SignedInfo
                  and
                count(ancestor-or-self::dsig:Reference |
                      here()/ancestor::dsig:Reference[1]) &gt;
                count(ancestor-or-self::dsig:Reference)
                  or
                count(ancestor-or-self::node() |
                      id('notaries')) =
                count(ancestor-or-self::node())
              </XPath>
            </Transform>
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue></DigestValue>
        </Reference>
      </SignedInfo>
      <SignatureValue>
      </SignatureValue>
      <KeyInfo>
        <RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#X509Data" URI="#object-4">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
              <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
                ancestor-or-self::dsig:X509Data
              </XPath>
            </Transform>
          </Transforms>
        </RetrievalMethod>
      </KeyInfo>
      <Object Id="object-1" MimeType="text/plain">I am the text.</Object>
      <Object Encoding="http://www.w3.org/2000/09/xmldsig#base64" Id="object-2" MimeType="text/plain">SSBhbSB0aGUgdGV4dC4=</Object>
      <Object Id="object-3">
        <NonCommentandus xmlns=""><!-- Commentandum --></NonCommentandus>
      </Object>
      <Object>
        <Manifest Id="manifest-1">
          <Reference Id="manifest-reference-1" URI="http://www.w3.org/TR/xml-stylesheet">
            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
            <DigestValue></DigestValue>
          </Reference>
          <Reference URI="#reference-1">
            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
            <DigestValue></DigestValue>
          </Reference>
          <Reference URI="#notaries">
            <Transforms>
              <Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" exclude-result-prefixes="foo" version="1.0">
                  <xsl:output encoding="UTF-8" indent="no" method="xml" />
                  <xsl:template match="/">
                    <html>
                      <head>
                        <title>Notaries</title>
                      </head>
                      <body>
                        <table>
                          <xsl:for-each select="Notaries/Notary">
                            <tr>
                              <th>
                                <xsl:value-of select="@name" />
                              </th>
                            </tr>
                          </xsl:for-each>
                        </table>
                      </body>
                    </html>
                  </xsl:template>
                </xsl:stylesheet>
              </Transform>
              <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
            </Transforms>
            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
            <DigestValue></DigestValue>
          </Reference>
        </Manifest>
      </Object>
      <Object>
        <SignatureProperties Id="signature-properties-1">
          <SignatureProperty Target="#signature">
            <SignerAddress xmlns="urn:demo"><IP>192.168.21.138</IP></SignerAddress>
          </SignatureProperty>
        </SignatureProperties>
      </Object>
      <Object Id="object-4">
        <X509Data>
          <X509Certificate>
MIIFAzCCBK2gAwIBAgIJAK+ii7kzrdq7MA0GCSqGSIb3DQEBBQUAMIGcMQswCQYD
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTE9MDsGA1UEChM0WE1MIFNlY3Vy
aXR5IExpYnJhcnkgKGh0dHA6Ly93d3cuYWxla3NleS5jb20veG1sc2VjKTEWMBQG
A1UEAxMNQWxla3NleSBTYW5pbjEhMB8GCSqGSIb3DQEJARYSeG1sc2VjQGFsZWtz
ZXkuY29tMCAXDTIyMTIxMzAyNDM0M1oYDzIxMjIxMTE5MDI0MzQzWjCBxzELMAkG
A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExPTA7BgNVBAoTNFhNTCBTZWN1
cml0eSBMaWJyYXJ5IChodHRwOi8vd3d3LmFsZWtzZXkuY29tL3htbHNlYykxKTAn
BgNVBAsTIFRlc3QgVGhpcmQgTGV2ZWwgRFNBIENlcnRpZmljYXRlMRYwFAYDVQQD
Ew1BbGVrc2V5IFNhbmluMSEwHwYJKoZIhvcNAQkBFhJ4bWxzZWNAYWxla3NleS5j
b20wggG2MIIBKwYHKoZIzjgEATCCAR4CgYEAk1RY6t+rHsrM5O1K5eh6TwjyXs5A
e7yoCvjgNDBoq5iMXdSQuNVhvB7uWzRe57HnsOgVzN/Wn1HQm9MBXTDqMOIFUUNs
XRh1N2J5r+nGkeCI7dNR0e9+AX4Ig1POnLMyavPIZUE416G6EBGuBXg5GqKarqMi
vZaYisd1zgDQ73UCFQCW+AvoVbNhefvALTAlJ3BF9tmPvQKBgG6PfovUavEmmn8t
byJdCoGomu5FW3OuM8cD8UhbUcyJ89CQ+UANRwp6WExNHwBFNFMD9EcvtDuA1Hag
rk7tiA/5J0pAW2ECAJ5qslbbsrwwELCRMIfF54TGm0evVJkgWGGPnpdPG3bfIqJp
RU78vxRVw/KOcp4xNnZ8MD9PTC29A4GEAAKBgFHJ5ds45f3jbW8RgLBoff4QJOib
WxNSKFsgLKyGWJRIGcGkqRteVAZRPqh8wLEpkTMZ8OaO19BaRO657bIHq2MY4ZwG
ERbS0SetDFrcgRBMd1CD2VAC2Dhc7O/DN0iQpB8PiPcaxILzv37vTA91589ZrO6A
Hd8Z8SLPk9PJ2B1oo4IBRTCCAUEwDAYDVR0TBAUwAwEB/zAsBglghkgBhvhCAQ0E
HxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFMX1b3lh
Q6X5NhzYrfWW4lQ1BFS8MIHjBgNVHSMEgdswgdiAFP7k7FMk8JWVxxC14US1XTll
WuN+oYG0pIGxMIGuMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTE9
MDsGA1UEChM0WE1MIFNlY3VyaXR5IExpYnJhcnkgKGh0dHA6Ly93d3cuYWxla3Nl
eS5jb20veG1sc2VjKTEQMA4GA1UECxMHUm9vdCBDQTEWMBQGA1UEAxMNQWxla3Nl
eSBTYW5pbjEhMB8GCSqGSIb3DQEJARYSeG1sc2VjQGFsZWtzZXkuY29tggkAr6KL
uTOt2q0wDQYJKoZIhvcNAQEFBQADQQBrFJH+gsRa6kUfHWVPdthbOuojc4v+EQcj
It3qQA/X8vk/ALH4VRDK+VNSFgwd+LTWo8uImp2H/1Vpk2SGBtKj
	  </X509Certificate>
        </X509Data>
      </Object>
    </Signature>
  </YoursSincerely>
  <PostScript>bar</PostScript>
  <Notaries xmlns="" Id="notaries">
    <Notary name="Great, A. T." />
    <Notary name="Hun, A. T." />
  </Notaries>
  <!-- Commentary -->
</Envelope>
<!-- Postamble -->
