Very basic XML parser example using PHP and the ‘–with-xml’ option.

<?php
$parser = xml_parser_create();
xml_parse_into_struct($parser,$xml,&$structure,&$index);
xml_parser_free($parser);
$i = 0;
foreach($structure as $s) {
if($s[”level”] == 2) {
// load results into $res variable
$res[$i] = $s[”value”];
$i++;
}
}
?>

##
The example above gets the level 2 value. You can do a var_dump($structure) to get the entire document/node structure.