There's a good chance that although the file itself is well-formed and valid XML that the applications using it are not getting their data from it via names but from the order of the entities. XML::Simple does not maintain the order of entities in the XML it reads and emits -- only the parent-child relationship of the tree is maintained. If you need to deal with a closed-source application that reads XML and cares anything about the ordering of child nodes of a particular parent, you'll need some XML tool that maintains that order.
Various monks will line up for caucus behind XML::Twig, XML::LibXML, XML::XPath, XML::DOM, XML::SAX, and more. Probably the best thing you can do is search the monastery (using super search or using a Yahoo or Google site-specific search perhaps) for XML module information to get the pros and cons of the different modules.
XML::Simple isn't just simple to use, but it's also kept simple in concept by idealizing XML. That's an ideal many packages don't follow, and you'll need a solution that deals better with those additional constraints on certain XML documents. Whether the order of child nodes in an XML document should matter is a deeper and more philosophical issue which won't do much good to argue. Other software developers are putting out code which expects certain nodes in a certain order, and you have to deal with it if you want to produce XML they will properly parse. I would caution you not to take their example if you decide to use XML for your own configuration files, but you're probably not going to change their minds about what's proper for their projects.
|