To repeat: every XML document must be WELL-FORMED.
New: an XML doc can be VALID -- which means a more strict requirements than WELL-FORMEDNESS.
Usually, the conformance to a DTD (Document Type Definition) of the doc is meant by the validity, or
more recently -- conformance with an XML Schema or other schema (RelaxNG, Schematron).