First and foremost, a valid XML document must be well-formed before it can even think about being a valid XML document. The well-formed requirement should be fairly straightforward, but the key that makes an XML document leap from well-formed to valid is slightly more difficult. To be valid, an XML document must be validated. A document can be validated through a Document Type Definition (DTD), or an XML Schema Definition (XSD). For the XML document to be valid, it must conform to the constraints |
expressed by the associated DTD or the XSD schema.