I tried this small example and it worked for me
XML:
<?xml version="1.0" encoding="UTF-8"?> <comune> <comune>Forli'</comune> </comune>
PHP:
$xml = simplexml_load_file('test.xml'); foreach($xml->children() as $child){ echo '<pre>'; print_r((string)$child); echo '</pre>asd'; }
OUTPUT:
Forli'
jimy
source share