- var_dump: documentation ( source)
<?php
$str = '<?xml version="1.0"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don\'t forget me this weekend!</body>
<recursive>
<val>2</val>
<val>4</val>
</recursive>
</note>';
$xml1 = new SimpleXmlIterator($str, 0, false);
$xml = (array) $xml1;
var_dump($xml);
echo $xml['note']['to'];
echo $xml['note']['recursive']['val'][0];