What Is XML?

XML has arisen from the need for a portable data format.

Essentially, XML is a standard for representing data in a text document. XML provides a framework for representing almost any kind of data, which is one of the reasons why it has attracted so much interest.

An XML document consists of text-based tags used to provide the document structure (similar to those used in HTML) together with the data itself. All XML documents consist of elements and optional declarations and comments.


An element has the following form:

<start_tag attributes>body<end_tag>

For example,

<book title="Teach Yourself J2EE in 21 Days">A very useful book</book>

In XML, unlike HTML, the tags are not predefined. As the author of an XML document, ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.