XML - XML Elements

Definition:
An XML element is a basic building block of an XML document. It consists of start tag to (including)the element's end tag.

An element can contain text,attributes, other elements.

Empty Element
Has no content; can be self-closed

<line-break />

Example:

<book id="101">

  <title>XML Basics</title>

  <author>Jane Doe</author>

 

</book>

 

  • An element with no content is said to be empty.
  • xml elements can be extended to carry more information