Example 4     <<      >>       intro       contents     

If the start-tag is in the content of another element, the end-tag is in the content of the same element. More simply stated, the elements, delimited by start- and end-tags, nest properly within each other.

  Well-formed documents   HOME     

Elements are properly nested. :

               <Weight>
                    <number>12</number>
                    <unit>grams</unit>
               </Weight>
               
            

Another well formed document:

               <book>
                    <chapter>
                         <title>Introduction</title>
                    </chapter>
                    <chapter>
                         <title>Story</title>
                         <subChapter>
                              <title>Part 1</title>
                         </subChapter>
                         <subChapter>
                              <title>Part 2</title>
                         </subChapter>
                    </chapter>
                    <chapter>
                         <title>Index</title>
                    </chapter>
               </book>
               
            

  Documents with errors   HOME     

Element <italic> is not properly nested:

               <text>
                    <bold><italic>XML</bold></italic>
               </text>