<?php
 function startElement($parser, $element, $atribuudid){
   echo "Algas $element ";
 }
 
 function endElement($parser, $element){
   echo "Lõppes $element ";
 }
 
 $xml_parser = xml_parser_create();
 
 xml_set_element_handler($xml_parser, "startElement", "endElement");
 $f=fopen("inimesed.xml", "r");
 while($andmed=fread($f, 4096)){
   xml_parse($xml_parser, $andmed, feof($f));
 }

 xml_parser_free($xml_parser);
 
?>