xml Building blocks Elements


Elements come with angle brackets are the most prominent building block of XML.

Elements can either be empty, in which case they are made of an empty tag (notice the ending slash):


Or they can have content, in which case they have an opening tag (no slash) and a closing tag (beginning slash):


Elements can nest (but only between opening and closing tags):

    Some more content.

Element names are called QNames (qualified names). All above elements are in no namespace, but element names can also be defined in namespaces using prefixes like so:

<my-namespace:parent-element xmlns:my-namespace="http://www.example.com/">
    Some more content.

Namespaces and element names are described in greater details in this section of the documentation.