- var_dump: documentation ( source)
- simplexml_load_string: documentation ( source)
<?php
$example = simplexml_load_string('<example xmlns:a="urn:a"><a:foo bar="baz"/></example>');
$a = $example->children('a', true);
$bar = (string) $a->foo->children('', true)['bar'];
var_dump($bar);