title: XML Signature DigestValue is invalid
body: <p>I am trying to sign XML file with PHP and xmlseclibs.
  However all validation tools say that my signature is invalid.
  XMLSpy says: "The calculated digest value doesn't match the digest of reference"</p>
  
  <p>This is my XML:</p>
  
  <pre><code>&lt;root&gt;&lt;value&gt;x&lt;/value&gt;&lt;/root&gt;
  </code></pre>
  
  <p>This is the digest I get:</p>
  
  <pre><code>KaMTM32K5rXl9U6MgG2BXuzNxoQ=
  </code></pre>
  
  <p>Methods I used to get it:</p>
  
  <p>1.) PHP:</p>
  
  <pre><code>$doc = new DOMDocument();
  $doc-&gt;loadXML('&lt;root&gt;&lt;value&gt;x&lt;/value&gt;&lt;/root&gt;');
  echo base64_encode(sha1($doc-&gt;documentElement-&gt;C14N(), true));
  </code></pre>
  
  <p>2.) OpenSSL:</p>
  
  <pre><code>openssl dgst -binary -sha1 test.xml | openssl enc -base64
  </code></pre>
  
  <p>3.) This website: <a href="http://hash.online-convert.com/sha1-generator" rel="nofollow">http://hash.online-convert.com/sha1-generator</a></p>
  
  <p>This is the digest that XMLSpy somehow gets and that works:</p>
  
  <pre><code>HedaN7TMgHgq2bRypzavMuFLoCg=
  </code></pre>
  
  <p>How do I get this digest?</p>