Thanks for replying, Jenda! I haven't tried XML::Rules before, but the technical reason why I switched to XML::Twig from XML::Simple was that XML::Twig would preserve the order of entries. (I later learned it'd also do cool stuff like DTD processing and a few other things I don't need right away.) Since XML::Simple was hash-based, there's no guarantee that ordering is preserved. From a glance at the XML::Rules page on CPAN, it looks like it may use hashes, too. Is that the case? If so, then I may be unable to use such a solution. It's also possible that I'm missing some way to solve the ordering problem.