cleanup+attempt to fix http://www.w3.org/TR/xmldsig-core/#sec-Same-Document