Valid XML Documents
A "valid" XML document is not the same as a "well formed" XML document.
A "valid" XML document must be well formed. In addition it must conform to a document type definition.
Rules that defines the legal elements and attributes for XML documents are called Document Type Definitions (DTD) or XML Schemas.
There are two different document type definitions that can be used with XML:
DTD - The original Document Type Definition
XML Schema - An XML-based alternative to DTD