in reply to Modify XML

Although there is an industry-standard method known as “XSLT” which can transform XML from one format to another (using another XML file to describe the transformations), I will very freely admit that I find it to be rather baffling every time I try to go that route.   (That is to say, every time I have to service legacy-code that went that route.)   Of course Perl supports XSLT.   However, I just like to use good ol’ XML::Twig and a little Perl code.   Twig is the “Swiss Army® Knife” for working with XML documents, and it can deal effectively with docs of any size at all.

Twig supports a subset of XPath (an industry-standard way of locating things within an XML structure), and I have found that this subset is usually plenty enough to get the job done.   For example, it is what you would use (as has already been demonstrated in another reply) to locate the areas, within the XML, that you want to change.