Elements

XML tags define elements. An element consists of a start tag, an end tag, and content enclosed within the tags. The syntax of a simple element is:

    <tag>content</tag>

In the code snippet on the right, the Messages element is called the root element because it contains all the other elements in an XML document. All XML documents must contain a root element.

An element can contain subelements. For example, in the code snippet on the right, the mail element contains the subelements to, from, subject, and body.

<Messages>
  
<mail>
    
<to> you@yourAddress.com </to>
    
<from> me@myAddress.com </from>
    
<subject> Car lights on </subject>
    
<body type= "text without graphic">     Owner of vehicle with license plate
    
454-561, your lights are on! </body>
  
</mail>
</Messages>
Click the Next button to continue.