if (file_exists( '1.xml' )) { $f = file_get_contents( '1.xml' ); $dom = new DOMDocument(); $dom->loadXML($f); $arr = array (); $params = $dom->getElementsByTagName( 'Table' ); $k = 0 ; foreach ($params as $param) { $params2 = $params->item($k)->getElementsByTagName( 'Row' ); $i = 0 ; foreach ($params2 as $p) { $params3 = $params2->item($i)->getElementsByTagName( 'Cell' ); $j = 0 ; foreach ($params3 as $p2) { $arr[$k][$i][$j] = $params3->item($j)->nodeValue; $j++; } $i++; } $k++; } foreach ($arr as $f) { echo '<table border="1">' ; foreach ($f as $r) { echo '<tr>' ; foreach ($r as $r1) { echo '<td>' ; echo $r1; echo '</td>' ; } echo '</tr>' ; } echo '</table>' ; } }