in reply to XML processing

Do yourself a favor and use another Modul to Filter your XML. I suggest XML::Twig or XML::SAX. The tool xml_grep from XML::Twig does exactly what you want.
xml_grep a your_xmlfile.xml
Boris