hi
Marsel,
Take a look at
XML::Twig "A perl module for processing huge XML documents in tree mode."
Update:You may also waht to take a look at
xmltwig.com, it has some example programs (as well as stacks of other information) which may be of interest to you.
Hope this helps.
Martin