XML is simply a self describing language. That means that when I create a document that contains:
It would mean that I have a collection of animals which are type Cat and Dog. That is a human readable aspect of it, the self-describing mechanism. The tags are structural elements and are how we logically divide the sections. It carries all meaning, and absolutely no meaning at the same time. I could just as easily have a text document:
What gives the XML the meaning is the doctype or schema in use, and how the language reading it interprets it. So that would indicate that the element name's chosen don't represent information, rather they represent a logical division of said information. Does that mean it doesn't represent information? No it doesn't. I could just as easily write the same document as:
And it may be just as valid as the previous (although IMHO I wouldn't consider this to be information as its structural, but that doesn't mean it cannot be treated as such). This is the point of XML; aside from syntax, there are no rules only how I interpret said rules.
The choice of names is for human readability, simply the associations we make as people. That would fall in line with why would I name a method
? Both are completely valid, and ultimately either can be chosen. Obviously I'll use the one that I can read though.
So the purpose of XML? To describe itself to another language based on the ruleset governed by the language itself. Take a soap service for example. The WSDL is a type of schema document that dictates what information is provided, and how its presented. This is then used by a soap client to know what and how it can ask for information from the soap server. It is loose, so you can provide a plethora of information to it regarding arguments and types, but its tight in the sense that it must come in a particularly described structure. This is the difference between well formed XML and correct XML. Correct XML is simply XML that is governed by a DTD or Schema ruleset and has adhered to it. Well formed is simply XML that has no particular meaning.