<pre>
<?
	// CS-75 XPath Examples

	// we define a constant value for referencing the XML file by name
	define("STORE_XML_FILENAME", "store.xml");

	$xml = new SimpleXMLElement(file_get_contents(STORE_XML_FILENAME));
	if(!$xml)
	{
		exit("Could not load XML from file '". STORE_XML_FILENAME . "'");
	}
	
	// gimmie the store's name
	//$results = $xml->xpath("/store/name");
	
	// retrieve the address xml element
	//$results = $xml->xpath("/store/address");
		
	// retrieve all of the categories
	//$results = $xml->xpath("//category");

	// retrieve all items with price < 5.00
	//$results = $xml->xpath("/store/menu/category/items/item[price < 5.00]");
	//$results = $xml->xpath("//item[price < 5.00]");
	
	// retrieve the description of the 'Mediterranean' 'Specialty Pizzas' element
	//$results = $xml->xpath("//category[@name='Specialty Pizzas']/items/item[@name='Mediterranean']/description");
	
	// retrieve all categories that contain 'Pizza' in the name
	$results = $xml->xpath("//category[contains(@name,'Pizza')]");
	
	print_r($results);
?>
</pre>