Valid XML
Unfortunately, having a sentence that includes the correct components does not necessarily result in something that makes sense. The words need to be included in the correct order and conform to grammatical rules. In this, XML is no different. However, as users of XML are effectively creating their own markup language, these rules are theirs to define. This is done through the Document Type Definition (a type of declaration) or more‑recently, XML Schema.
An XML Schema definition is effectively a DTD written in XML, with all of the accompanying benefits of extensibility. Another added advantage is its support for data types in describing the rules for an XML document’s content.
To be structured and interpreted correctly, XML documents must be both well‑formed and valid.