Imagine a technology that offered you all the power of a DTD without the associated unpleasantness of those strange symbols and arcane commands. Sounds too good to be true? Say hello to XML Schema.
Finally, comments. Since a schema definition is a well-formed XML document, you can include as many comments within it as you like, by enclosing each within the standard comment indicators. In addition to this, the XML Schema specification also allows schema authors to include human-readable comments in the <xsd:annotation> element. The following example illustrates this:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation>Hail,
fellow Romans!</xsd:documentation>
</xsd:annotation>
<xsd:simpleType
name="simpleDType">
<xsd:annotation>
<xsd:documentation>This datatype
restricts values to integers between 1
and 10, both inclusive</xsd:documentation>
</xsd:annotation>
<xsd:restriction
base="xsd:integer">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive
value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>