- var_dump: documentation ( source)
<?php
$xml = new DOMDocument();
$element = $xml->createElement('saml:Assertion');
$xml_saml_assertion = $xml->appendChild($element);
$attribute = $xml->createAttribute('id');
$attribute->value = 'IDCard';
$xml_saml_assertion->appendChild($attribute);
$attribute = $xml->createAttribute('xmlns:saml');
$attribute->value = 'urn:oasis:names:tc:SAML:2.0:assertion';
$xml_saml_assertion->appendChild($attribute);
$attribute = $xml->createAttribute('Version');
$attribute->value = '2.0';
$xml_saml_assertion->appendChild($attribute);
var_dump($element->attributes[1]);