in reply to Perl with XML

If this is a homework then I would like to -- both you (for not running the code under the debugger, using Data::Dumper or generally searching this site and the web for information on Perl and XML) and your teacher. XML SHOULD NOT BE PARSED USING REGEXPs (unless you seriously know what you're doing, as Paul Kulchenko in XML::Parser::Lite or Matt Sergeant in his new pure Perl parser). See On XML parsing for a few reasons (and I am not even mentioning non-ascii encodings in that post).

Now if you are looking for resources on Perl and XML you can have a look at xml.com, which carries a series of really good articles by Kip Hampton on Perl and XML, I have a couple of resources on xmltwig.com and the Mother of all XML resources is of course The XML Cover Pages, which even has a section on Perl and XML.

Update: Oh my! I forgot to mention a web site dedicated to Perl and XML: xmlperl.com!