DTD Tree Structure
==================

root  # Name given by caller.
{
  <element name>
  {
	  type { [empty | element | mixed | any] }
    attr  # Optional.
    {
      <attribute name>
      {
        type { [data | token | tokens | id | idref | idrefs | enum | entity |
                entities | notation] }
        presence { [open | required | implied | fixed] }
        default { <default value> }       # Optional.
        possible { <value> <value> ... }  # Optional.
      }
      ...
    }
    part  # Optional.
    {
      [choice | sequence]
      {
        [choice | sequence] { ... }
        [name] { ... }
        [data]  # Zero or one.
        ...
      }
      [name]
      {
        <element name>  # Always defined at root level.
        {
          presence { [zero-one | one | one-many | any] }
        }
      }
      [data]  # Zero or one.
      ...
    }
  }
  ...
}


XML Tree Structure
==================

# comment: Works like data (described below) but does not go into the
#          displayed document. Just ignore these.

comment
{
  <comment text>
}
  
  
# ---
  
  
# pi: Meta-information. Ignore these.
  
pi
{  
  name { <tag name> }
  data { <tag data> }
}
      
      
# ---
      
      
# data: Describes a segment of pure text to print in this location.
#       Does not contain any other subnodes.
      
data
{      
  <text>
}
        
        
# ---


# tag_empty: Empty tag, which means it only describes the tag itself and
#            its attributes.

tag_empty
{
  <tag name>
  {
    attr { <attribute name> { <attribute data> } }
  }
}


# ---
          
          
# tag_span: Spanning tag, which means it describes a tag and its attributes,
#           with optional tags and textual data nested inside.

tag_span
{
  <tag name>
  {
    attr { <attribute name> { <attribute data> } }
    data { <text> }
    tag_span { ... }
    tag_empty { ... }
    ...
  }
}


