If you aren't yet convinced on the merits of XML::Twig, note that you can parse chunks of the code using any module you like by passing the "twig" to a second parser. For example, you can use Twig to pull out each section of a file then use XML::DOM to parse and operate on it. Finally, there is
XML::Twig::XPath which combines Twig and XPath for a very powerful tool for quickly and with minimal memory footprint.
Sean