Using PHP's SimpleXML i would like to get the key and child of an element. The first element if there are more then one. How do i do this? the 2nd line doesnt make sense so how would get the first key/val of the first element?
$body = $xml->Body;
$xml->Body->children() as $XX=>$ZZ;
echo "x $XX $ZZ\n";
foreach($xml->Body->children() as $k=>$v){
echo "$k $v\n";
}