1) Below is the code using the XML Attribute and elements
<Person location = “India”>
<Statename>Maharashtra</Statename>
<Cityname>Mumbai</Cityname>
</Person>
<Person>
<Location> India </Location>
<Statename>Maharashtra</Statename>
<Cityname>Mumbai</Cityname>
</Person>
In the first element, location is an attribute. In last, location is an element. The user can choose the attribute or element.