<?php
/****************************************************************************************
 * PHP XML DOM functionality
 ****************************************************************************************/

$xmlDoc = new DOMDocument();
$xmlDoc->load("file1.xml");

print $xmlDoc->saveXML();

print "<br /><br />";

$doc = $xmlDoc->documentElement;
foreach ($doc->childNodes as $item)
{
  print $item->nodeName . " = " . $item->nodeValue . "<br />";
}
?>