Yes, I'm quite familiar with those functions. For one of my projects had to parse XML orders from Yahoo and stuff everything into a MySQL database. The PHP XML parsing functions were a big help.
Here's the basic setup I wrote for my parser:
$p = xml_parser_create();
xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, 1);
xml_set_element_handler($p, 'xmlStartHandler', 'xmlEndHandler');
xml_set_character_data_handler($p, 'xmlCharHandler');
xml_parse($p, $all_the_xml);
xml_parser_free($p);
My handler functions are defined with these interfaces:
// the opening tag
function xmlStartHandler($parser, $tagname, $attribs)
// the closing tag
function xmlEndHandler($parser, $tagname)
// the data between
function xmlCharHandler($parser, $string)
The body of each of these functions is too complex to go into detail here, but if you just have them print out the arguments they receive you'll see how they are called, and in what order, with respect to your XML data. I'm using the default parsing behavior, which is probably what you'll use, but I believe you can tell the parser to do a depth-first traversal if you prefer.