XML stands for Extensible Markup Language. It represents yet another effort by the W3C to divorce content from presentation. Whereas CSS allows us to take most formatting out of a document, but continues to require a restricted set of typesetting commands concerning the structure of the document, XML removes most of the restrictions on the structural commands. For example, HTML still contains the <hr> tag, which is not so structural, instead giving information about a graphical item. Likewise, the table command on which so many HTML documents rely has more to do with formatting than with structure. By contrast, XML allows an author to determine the structure of a document, create tags to describe that structure, and leave all the formatting for later.
XML has a stricter syntax than HTML, but really has very few rules. The only requirements for a well-formed XML file are as follows. We should properly use the word "element" instead of "tag" here, but we believe that tag is more evocative of the way we will implement XML, and will do for this course.
What are the tags? That is up to us. We can define the tags, their relationship to each other, and the way in which their content will be formatted on a page. As you can see, this means that every XML document actually relies on at least two other files.
A Data Type Definition (DTD) file contains the rules regarding relationships among the tags we define. We do not really require a DTD, but it allows us to define default values, and enforces our syntax across many different XML documents.
In addition to a DTD, the presentation of our XML requires an associated style file to tell how it is to be formatted. The style file could be done in CSS - see this sample XML with CSS formatting. As you can see, the control over the appearance is limited. For that reason the X Stylesheet Language was invented - XSL. XSL is a much more versatile language for XML formatting, allowing us to include some typesetting commands in addition to formatting instructions. In short, XSL can handle all procedural matters, while XML is exclusively structural. You can view more examples of that same sample XML file here, here, and here.