- simplexml_load_string: documentation ( source)
<?php
$xml = "<root>
<alfa>
<one>
<two>
</alfa>
<beta>
<bhi>
<bho>
</beta>
</root>";
$xml = simplexml_load_string( $xml);
foreach( $xml->children()->children() as $child) {
echo $child->getname(). "\n";
}