diff --git a/src/XML/saml/Assertion.php b/src/XML/saml/Assertion.php index c1a9d37d8..997f480a7 100644 --- a/src/XML/saml/Assertion.php +++ b/src/XML/saml/Assertion.php @@ -17,6 +17,7 @@ use SimpleSAML\SAML2\XML\EncryptableElementTrait; use SimpleSAML\SAML2\XML\SignableElementTrait; use SimpleSAML\SAML2\XML\SignedElementTrait; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; @@ -326,7 +327,10 @@ public static function fromXML(Dom\Element $xml): static if (!empty($signature)) { $assertion->setSignature($signature[0]); $assertion->wasSignedAtConstruction = true; - $assertion->setXML($xml); + + $doc = DOMDocumentFactory::create(); + $doc->appendChild($doc->importNode($xml, true)); + $assertion->setXML($doc->documentElement); } return $assertion;