XML Elements

What are XML elements?

An XML element is everything from the XML element’s starting tag to the XML element’s ending tag.

An element can contain:

  • Starting tag
  • Attributes
  • Text
  • Closing tag
  • other elements
  • or a combination of all things mentioned above.


<author category=”literature”> sameed </author>

In this example;

<author> is the starting tag

sameed is the text

Category is the attribute/property

Literature is the value of the attribute.

</author> is the closing of the tag.

XML Naming Rules:

  • Element name is case-sensitive:
  • Element name must start with a underscore or alphabets.
  • Element name cannot start with the letters XML/xML/xml/Xml, etc.
  • Element name cannot contain spaces
  • Element name can contain digits,  letter, hyphens, periods and underscore. 
  • Element name can have any name except xml.



Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....

Leave a Reply