XML - Tag


Text inside


are called tags.

Tags nearly always come in pairs:

or are:

Tags also nest. You should close them in the right order: the most recently opened tag should be the first one closed.

When there is content between the tags, the entire structure is called an element and the text between the start-tag and end-tag is called the element's content




  • are case-sensitive
  • must start with a letter or underscore
  • cannot start with the letters xml(or XML, or Xml, etc)
  • can contain:
    • letters,
    • digits,
    • hyphens (-)
    • underscores (_),
    • and periods (.)
  • cannot contain spaces



The beginning of every non-empty XML element is marked by a start-tag.

An example of a start-tag:

<termdef id="dt-dog" term="dog">


The end of every element that begins with a start tag MUST be marked by an end-tag containing a name that echoes the element's type as given in the start-tag.

An example of an end-tag:



An Empty-element tag is also known as self-close. Note the / in the tag to close it.

It may be used to describe any element which has no content,

Examples of empty elements tag:

<IMG align="left" src="http://www.w3.org/Icons/WWW/w3c_home" />

Documentation / Reference

Powered by ComboStrap