XML is an incredibly simple, well-documented, straightforward data
format. XML documents are text and can be read with any tool that can
read a text file. Not just the data, but also the markup is text, and
it's present right there in the XML file as tags.
You don't have to wonder whether every eighth byte
is random padding, guess whether a four-byte quantity is a
two's complement integer or an IEEE 754 floating
point number, or try to decipher which integer codes map to which
formatting properties. You can read the tag names directly to find
out exactly what's in the document. Similarly, since
element boundaries are defined by tags, you aren't
likely to be tripped up by unexpected line-ending conventions or the
number of spaces that are mapped to a tab. All the important details
about the structure of the document are explicit. You
don't have to reverse-engineer the format or rely on
incomplete and often unavailable documentation.
A few software vendors may want to lock in their users with
undocumented, proprietary, binary file formats. However, in the long
term we're all better off if we can use the cleanly
documented, well-understood, easy to parse, text-based formats that
XML provides. XML lets documents and data be moved from one system to
another with a reasonable hope that the receiving system will be able
to make sense out of it. Furthermore, validation lets the receiving
side check that what it gets is what it expects. Java promised
portable code; XML delivers portable data. In many ways, XML is the
most portable and flexible document format designed since the ASCII
text file.
 |  |  |
1. Introducing XML |  | 1.3. How XML Works |