Yo te recomiendo el uso de XPATH no es complicado. Ejemplo,
Código PHP:
Ver original<?php
$str = <<<XML
<foo>
<bar>
<candy>snickers</candy>
<fruits>apple</fruits>
</bar>
<bar>
<candy>twix</candy>
<fruits>pear</fruits>
</bar>
<bar>
<candy>kitkat</candy>
<fruits>grape</fruits>
</bar>
</foo>
XML;
$xml = new SimpleXMLElement($str);
$candy = $xml->xpath('//candy');
$fruits = $xml->xpath('//fruits');
foreach($candy as $v){
echo 'candy = ' . $v . '<br />';
}
foreach($fruits as $v){
echo 'fruits = ' . $v . '<br />';
}
/**
* Leer todo junto
*/
$bar = $xml->xpath('//bar');
foreach($bar as $v){
echo 'candy = ' . $v->candy . ' vs fruits = ' . $v->fruits . '<br />';
}
Vez que sencillo es trabajar con simpleXML.