The same problem with XML and XSL is the same problem we encounter in my company. We first worked out with XML::Twig, but in big files crash out. We manage to make a version on using Twigs API, without parsing etc, but again the time wasnt good. While mentioned, take a look in microsoft .net studio. This is the adopted solution in my company. In .net they try to handle xml with various ways in order to accomplish some flexibility. It might is the case where you should change from perl to net studio.