I am having an issue getting xml data in phpMy xml is fairly complicated and there are several nested children in the tag.xml\[code\]?xml version="1.0" encoding="UTF-8"?><book id="5"><title id="76">test title</title><figure id="77"></figure><ch id="id78"><aa id="80"><emph>content1</emph></aa><ob id="id_84" page-num="697" extra-info="4"><emph type="bold">opportunity.</emph></ob><ob id="id_85" page-num="697" extra-info="5"><emph type="bold">test data.</emph></ob><para id="id_86" page-num="697">2008.</para><body> ..more elements <content>more contents.. </content></body></ch>\[/code\]MY codes\[code\]//I need to load many different xml files. $xml_file = simplexml_load_file($filename); foreach ($xml_file->children() as $child){ echo $child->getName().':'. $child."<br>"; }\[/code\]The codes above would only display \[code\]book, title, figure, ch\[/code\] but not the elements inside the \[code\]ch\[/code\] tag. How do I display all the element inside each tag? Any tips? Thanks a lot!