ok's title, price, author, and so on, much like fields in a database.
<ORDER>
<SOLD-TO>
<PERSON><LASTNAME>Layman</ LASTNAME><FIRSTNAME>Andrew</FIRSTNAME>
</PERSON>
</SOLD-TO>
<SOLD-ON>19970317</SOLD-ON>
<ITEM>
<PRICE>5.95</PRICE>
<BOOK>
<TITLE>Number, the Language of Science</TITLE>
<AUTHOR>Dantzig, Tobias</AUTHOR>
</BOOK>
</ITEM>
<ITEM>
<PRICE>12.95</PRICE>
<BOOK>
<TITLE>Introduction to Objectivist Epistemology</TITLE>
<AUTHOR>Rand, Ayn</AUTHOR>
<ISBN>0-452-01030-6</ISBN>
</BOOK>
</ITEM>
<ITEM>
<PRICE>12.95</PRICE>
<RECORD><TITLE><COMPOSER>Tchaikovsky</COMPOSER>'s First Piano Concerto</TITLE>
<ARTIST>Janos</ARTIST>
</RECORD>
</ITEM>
<ITEM>
<PRICE>1.50</PRICE>
<COFFEE >
<SIZE>small</SIZE>
<STYLE>cafe macchiato</STYLE>
</COFFEE >
</ITEM>
</ORDER>
In addition to the fact that none of these tags describes what the data will look like when you view it (that's up to the DTD), there are two other notable differences between HTML and XML:
First, note that each tag has a matching end tag (HTML is more lenient about this). Note also how elements are nested -- an element may contain text and other elements, but elements may not overlap. XML calls anything that appears between an element's start and end tags the element's contents.
Second, XML documents should begin with a declaration of the XML version being used:
<?xml version="1.0"?>
This allows an XML "processor" -- a kind of parser -- to automatically recognize the version of a document it receives and reject versions it does not support. Unlike HTML browsers, which simply ignore syntax they don't understand, XML parsers can reject content.