- var_dump: documentation ( source)
<?php
$doc = new DOMDocument;
$doc->loadXML('<?xml version="1.0" encoding="utf-8" ?><example><foo bar:baz="bat"/></example>');
$foo = $doc->getElementsByTagName('foo')->item(0);
var_dump(
$foo->lookupnamespaceURI('bat'),
$foo->getAttributeNS(NULL, 'baz')
);