/    /  XML – Documents

XML – Documents

XML Document forms the full struture of xml formatted data composed with prolog and root element nested with other elements.There would be only one root element, where root element encloses many other elements inside the final inner element holds the data. XML Document can be divided as three components. They are:

1. Prolog

2. Elements (Root or Other)

3. Data

Below is the example of Customers XML document with the root element “customer_list”

<?xml version="1.0" encoding="UTF-8"?> 
<customer_list> 
	<customer> 
		<name> Sanjay</name> 
		<location> Mumbai</location> 
	</customer> 
	<customer> 
		<name> Micheal</name> 
		<location> Washington</location> 
	</customer> 
</customer_list> 

In the above example,

Document Prolog — <?xml version=”1.0″ encoding=”UTF-8″?>
Root Element — <customer_list>
Other Elements — <customer> , <name> , <location>
Data — Sanjay, Mumbai, Washington, Micheal