XML syntax closely resembles HTML; data is enclosed between opening and closing tags. However, XML is more flexible than HTML:
XML encodes data in tightly-validated tree structures. Data is easy to locate since its context is well defined by tags and rules of structure.
HTML attempts to control the appearance and presentation of data, while XML does not. XML defines data separately from its presentation. This makes XML data easier to locate and manipulate.
XML is a standard data format that permits applications to exchange information across platforms and operating systems. HTML is markup used to display information in a web browser.
XML is open and extensible. XML authors can create their own tags. HTML is limited by a fixed vocabulary that browser developers have agreed to support. In fact, XML has no predefined tags of its own. New XML tags are defined as needed —to define any type of data using syntactical rules that that permit browsers and XML Parsers to interpret proprietary tags on the fly. XML can describe any kind of data, such as a row in a table, a chemical formula, a financial transaction, a short story, or an object that exposes methods and properties—with equal finesse.
Since XML is plain text, it is easily transmitted between computers and through firewalls. XML is more secure than binary files, since text files cannot be executed directly. Binary files, on the other hand, can contain malicious computer programs.
XML is universally compatible. The XML file format is not tied to any particular program, operating system, database, or network. XML can be used by non-web applications to store data.