For example, how would you code a catalog of books in HTML? Perhaps you would use a table:
<TABLE>
<TR>
<TH>Author</TH>
<TH>Title</TH>
</TR>
<TR>
<TD>Honore de Balzac</TD>
<TD>Charles Dickens</TD>
</TR>
<TR>
<TD>Cousin Bette</TD>
<TD>Little Dorrit</TD>
</TR>
</TABLE>
The HTML document presents the data in rows and columns, and we may easily add extra formatting to control font size, cell color, and other markups. The tags format the information, but cannot describe it, and are incapable of being altered to meet specific requirements. Additionally, they are the same for every document.
Consider the same information displayed in XML format:
<CATALOG>
<BOOK>
<AUTHOR>Honore de Balzac</AUTHOR>
<TITLE>Cousin Bette</TITLE>
</BOOK>
<BOOK>
<AUTHOR>Charles Dickens</AUTHOR>
<TITLE>Little Dorrit</TITLE>
</BOOK>
</CATALOG>
In contradistinction to the HTML code above, the XML document is focused on adding structure to the data in the form of elements. The elements describe what the data actually is. We know that our document must be a book catalog and that it must specify authors and titles.