I always hated having to manually parse out an XML file back in the day. but now, as of not really that recently, you can use SimpleXML to automatically convert an XML file to an array-like structure of objects. you do have PHP5, and the php-xml package, right?
$sxml = simplexml_load_file($filename,'SimpleXMLElement',LIBXML_NOCDATA);
print_r($sxml);
amazing, eh? the LIBXML_NOCDATA keeps all CDATA enclosed data from disappearing on import.
$filename = "some_file.xml";
// this works too, if your server allows it
// $filename = "http://www.remote.xml/filename.xml";
$sxml = simplexml_load_file($filename,'SimpleXMLElement',LIBXML_NOCDATA);
$sxml->page; // references body of an XML element
$sxml->page->attributes(); // returns attributes
foreach ($sxml->page->attributes() as $key=>$val)
{
print "Value of $key is $val
";
}