XML – Elements
XML Element is the main component which holds the data from start tag till end tag. XML document consists one or more elements enclosed in root element. Elements naming represent the self-explanatory form of data inside it. Elements contains attributes which are used to specify additional information about the element.
<?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:
Customer_list is the root element and customer, name are inner elements.