in reply to sub foo:bar {}?

I know I'm getting annoying, but ... you might want to have a look at XML::Rules. It's built on top of XML::Parser (well, XML::Parser::Expat) and even though it's basicaly an event based parser (though you don't have to look at it that way) the handlers tend to be simpler than the ones you have to write for XML::Parser or other event based parsers.