The XML (eXtensible Markup Language) is used for data exchange purposes. XML syntax at a glance looks very similar to HTML but it is used only for saving data, albeit in a more organized way. By default, an XML file is just a plain text document which actually does nothing.
To make use of XML we require applications which really read the file data and do anything meaningful based on them, and hence XML parsers come into the picture. XML is an open standard, free, and is recommended by W3C (the World Wide Web Consortium).
The purpose XML was built is that data stored in flat files (or normal data files) are a big trouble to handle while transporting or reading them. For every flat file, the developer needs to write their own parser that is tailor-made for their purpose. But that’s not the case with XML, a generic XML parser is used and the developer only needs to write code to parse the document using the parser, not the parser itself. XML format focuses on code readability and ease in parsing.
An XML document looks like the following:
<?xml version=”1.0″ encoding=”UTF-8″?>
<student>
<name>James Jones</name>
<roll >PACKT/1001/16</roll>
<dob>17-01-1947</dob>
<address>Birmingham, United Kingdom</address>
</student>