XML
eXtensible Markup Language (XML), is a plain text format used to store structured data. XML is written to be both human and machine readable.
XML documents often begin with a declaration, as shown here:
<?xml version="1.0"?>
The declaration has three possible attributes. The version attribute is mandatory when a declaration is included:
version
: The XML version, 1.0 or 1.1encoding
: The file encoding, most frequentlyutf-8
orutf-16
standalone
: Whether or not the XML file uses an internal or external Document Type Definition (DTD), permissible values are yes or no
Elements and attributes
XML is similar in appearance to HTML. Elements begin and end with a tag name. The tag name describes the name of an element. For example:
<?xml version="1.0"?>
<rootElement>value</rootElement>
An XML document can only have one root
element, but an element may have many descendants:
<?xml version="1.0"?>
<rootElement>
<firstChild>1</firstChild>
<secondChild...