Considering the following piece of XML and the code to load it with SimpleXML :
$str = <<<XML
<root>
<a>
<b>
<c>glop</c>
<d>test</d>
</b>
</a>
</root>
XML;
$xml = simplexml_load_string($str);
You could "cast" $xml->a->b
to an array, to be able to iterate over it :
foreach ((array)$xml->a->b as $name => $value) {
echo "$name : $value<br />";
}
And you'll get this kind of output :
c : glop
d : test
(maybe not exactly the same XML string as yours, but I hope this will help you get to the solution -- if it does, can you edit your question to show us you XML data, and the output you'll willing to get ? )
Quoting the manual page, at the Converting to array section :
If an object is converted to an array,
the result is an array whose elements
are the object's properties.
The keys
are the member variable names, with a
few notable exceptions: integer
properties are unaccessible; private
variables have the class name
prepended to the variable name;
protected variables have a '*'
prepended to the variable name.