Architecting and designing : XML schema design : XML history and topics of interest : What is an XML document?
  
What is an XML document?
An XML document is simply a collection of XML tags, and can be thought of as a container for data. They are similar to tables in a relational database and objects in an object-oriented language. For instance, in relational databases the Data Definition Language (DDL) is used to define new data types and create tables using those types, while specifying rules and constraints on columns in those tables. You can then insert data into the tables, and the database will ensure that your rules and constraints are enforced.
An XML document allows you to define an unlimited set of tags. It contains one or more elements containing attributes, other elements, and text. As with database tables and object-oriented classes, you need to define rules about the structure, permissible data types and constraints that apply to each element within the document. An XML document can then be considered an instance of this class definition and therefore be validated against the definition at runtime.
An XML element can declare its associated data to be an address, a title, a name, an amount, or any other desired data. For example:
<directors>
  <name>Martin Scorcese</name>
  <country>America</country>
  <city>New York</city>
  <honors>1997 Lifetime Achievement Award</honors>
</directors>
XML allows the integration of varied applications and the data they create, providing the ability to search for and manipulate data regardless of the applications within which it is found, without return trips to the server. When data has been located, it can be handed off to other client applications for further processing and viewing, or presented in a browser such as Internet Explorer.
As XML tags are adopted throughout the organization, employees, suppliers, and customers can share and reuse information, establishing an important common ground.
See also
What is an XML instance?
XML history and topics of interest