Good guess, XML is not by default the simplest method of storing plain text data. It depends on a lot of things, mostly what existing tools you are planning to use. Some questions to ask yourself before choosing XML:
- Do you feel XML editors make you (or your team) more productive? (If you are a programmer, used to a text editor, the answer is probably no.)
- Do you want schema validation? (Will your data structure be complex enough to require this.)
- What will XML bring to the table another, less verbose, easier text-editable, plain text configuration language doesn't have?
As Jonathan Blow eloquently put it:
Many modern programmers seem to have some kind of knee-jerk inclination to use XML whenever a textual format is desired, but I think XML is one of the worst file formats ever created, and I have no idea why anyone uses it for anything at all, except that perhaps they drank the XML Kool-Aid or have XML Stockholm Syndrome. Yes, there are XML-specific tools out there in the world, and whatever, but I didn’t see how any such tool would be of practical use to us. One of our primary concerns is human-readability, so that people can make intelligent decisions when attempting to resolve revision control conflicts. XML is not particularly readable, but we can modify our own format to be as readable as it needs to be in response to whatever real-world problems arise.
Some alternatives are:
- the INI file format
- the .properties format, if you should be using Java
- Lua as a configuration language, if you were using Lua for programming/scripting anyway
- your own format, see the above blog post, be sure to consider expressiveness, readability, version controllability