Hi all I need to parse xml pieces. In most cases I may need to change the value of an attribute or two and then emit the modified XML. The XML::Simple with the XMLin and XMLout seemed to be the best solution. But... I have a new requirement. Let'e consider this structure:

what I need is to traverse on that tree and gather the values of, let's say, attribute3, attribute4, attribute7 and based on their values decide whether to retain that specific criterion or chop it away. And when done, emit the modified xml. 1. What would be the best module to do all the above? 2. How should I approach it?

There are various tools for parsing XML, it usually comes down to a matter of preference. My preference is nearly always XML::LibXML. Though I commonly see XML::Twig recommended.

You haven't provided enough detail to provide you with a valuable approach, but this will come once you understand how to use the tool of your choice. Learn how to use it to parse XML, modify XML, then write XML.