It's a fact of life that XML, which stands for eXtensible Markup Language, is invading our lives more and more as programmers, and I feel this is a good thing. The reason being XML has the ability to cross all sorts of boundaries, and probably the only chance we have to obtain a truly independent, cross-platform data transfer format.
HTML has a fixed set of element types, for example TITLE, H1, H2, EM, BODY, P, HR, and so on. A valid HTML document must use these elements. It cannot invent its own. A browser vendor can of course add its own proprietary tags (for instance, Netscape's <BLINK> tag), but there is no standard way to introduce new element types. While this is not the case with XML. XML has the ability to define new elements, and furthermore, this can be done in the document itself. Thus, XML documents are in essence self-describing. Let's consider an example. Imagine that you are looking at an HTML document with the following table in it:
Visual Basic Programming
Naven Gokul Anna
Patricia Mary Sasi
<td> <i>Visual Basic Programming</i> </td>
<td> Eduwardo Wancelloti </td>
<td> Naven<br> Gokul <br> Anna </td>
(and so on for each row)...
Although we as humans or programmers can make an educated guess, we really have no way of knowing what this data represents. Is "Visual Basic Programming" the name of a book? A course opted? Skill set required? It is impossible to say. And if it's a course (as appear to be), are there three named participants registered (Naven, Gokul, and Anna). Or just one named Naven Gokul Anna? XML fixes this. The corresponding information would be represented in XML like this:
The lesson here is tags can be anything you like, it is only how you use them that gives them meaning. Of course it is sensible to give meaningful names to start with. In the above example we have used XML to describe data, and we’ve used tag names that represent field names of the data. Thus in XML, information about the data structure can be preserved. It’s standard text, so can easily transfer from machine to machine. It’s not in proprietary format, so anyone can read it, and if the tags are named sensibly, the XML is self-describing. Furthermore, all information concerning presentation style has been removed from the document. We can say that this XML document evidently supports an element named "course," and the question you should be asking yourself is: But how am I supposed to know how to format this? (Notice that the HTML code contains a style directive for the text "Visual Basic Programming;" for example, the element indicates italics.