Architecting and designing : XML schema design : XML history and topics of interest : What is a document type definition (DTD)? : Well formed and valid documents
  
Well formed and valid documents
A well-formed XML document conforms to the general rules of XML syntax. Well-formed documents simply require that all elements are cleanly nested. For instance, an XML character data is never left hanging without an ending markup designation of some sort, either an end tag, as in the tag pair:
<MYTAG></MYTAG>
or a special empty element tag with a forward slash before the right angle bracket, such as:
<MYTAG/>
XML markup always starts with a left angle bracket or an ampersand; element types and attribute names are case-sensitive; attributes require quotation marks; and so on.
A valid XML document must include and adhere to a specific DTD (see Document type definition (DTD)). While XML-capable browsers look only for well-formed XML to read XML documents, validating parsers in XML authoring and publishing tools check the conformance of documents against their DTDs for well-formedness and validity.
See also
What is a document type definition (DTD)?