<div dir="ltr"><div>Hi,<br></div><div>   I have encountered an issue in Opensaml when marshalling an existing SAML assertion into a newly created empty Document. Apparently AbstractXMLObjectMarshaller.marshall(assertion, Document) uses Document.adoptNode() followed by Document.appendNode(..) but neither of these preserve the IDness of the assertion and if Document.getElementById(assertionId) is used on the resulting document, it returns null.<br></div><div>I have initially reported this issue in Axiom (<a href="https://issues.apache.org/jira/browse/AXIOM-482">AXIOM-482</a>), thinking that it might be caused by Axiom DOM implementation, but then I noticed it is reproducible with Xerces as well and I saw that Xerces folks do not consider this a bug in Xerces DOM implementation - they argue that according to spec, the adoptNode() is not required to preserve the ID attributes, see <a href="https://issues.apache.org/jira/browse/XERCESJ-1022">XERCESJ-1022</a> and respective discussion:<br><a href="https://mail-archives.apache.org/mod_mbox/xerces-j-users/200701.mbox/%3C20070125062002.01E3310FB003@herse.apache.org%3E"> importNode()/adoptNode() and getElementById()</a><br><br></div><div>Does this mean that this is a bug in Opensaml/Xmltooling and Xmltooling node adoption code is required to ensure the ID attributes are preserved when marshalling into a new Document?<br><br></div><div>Regards,<br></div><div>   Detelin<br></div></div>