in reply to searching in document parsed by XML::Parser

If you want to access the document content you might be better off using one of the modules built on top of XML::Parser:

You can also use a module not based on XML::Parser. XML::libXML for example builds a DOM, and allows you to use XPath to query the document.