To be valid an XML document must be
Well-formed
Must have a DOCTYPE declaration specifying a Document Type Definition (DTD)
DOCTYPE
Must comply with the constraints specified in the DTD