Like HTML, XML is a markup language that can be used to represent complicated data in a hierarchical format. Because XML tags are user -defined, there's no limit to the kind of information you can embed into an XML document. Listing 10.1 shows a sample XML document.
<?xml version="1.0"> <customer type="web"> <firstName>Ian</firstName> <lastName>Young</lastName> <address>555 Downtown Ln</address> <city>Cincinnati</city> <zip>45023</zip> </customer>
In this case, the XML document in Listing 10.1 describes a customer of a fictitious Web site. The data and attributes were made up, yet if you were to run an XML parser on Listing 10.1, it would correctly identify each attribute and piece of data.
An XML parser is a program that reads an XML document and extracts the data and data descriptions from the XML data. An XML parser enables you to programmatically work with an XML document without having to manually parse the file.
XML is important because it lays the foundation for applications to share information, by providing an agreed-upon data transfer format.