As a general rule, I love XML. I've been using it for a good 10 years now, and it's never failed me. Except when I hit that wall of whether to deal with it as an XML file or a text file. After all there are a million text utilities out there for searching, replacing, counting, analyzing, editing and so forth. With your XML file, once you take it out of its application context you're left with either treating it like a fairly wordy text file, or else loading it up into a dedicated XML editor. Even then, it's hard to accomplish bulk tasks like "Transform these 300 XML files using this style sheet" or "Extract out all the different values for Career/Title that are used".
XmlStarlet gives you the ability to manipulate your XML files directly from the command line, and it is awesome. Here's just some of the things you can do:
- XSL Transformations.
- Search and extract. Far more useful than just grepping for your text, you can use XPath to go exactly to the element (or elements) you want.
- Editing. Insert/delete/move stuff around.
- Validate against a DTD or Schema.
Remember, if you can do it from the command line, you can do it from a script. Highly recommended app.