This section covers the well-formedness constraints as they apply to areas other than elements and attributes. Several of the well-formedness rules will make more sense after you have read Chapters 4 and 5.
To be well formed, XML comments must not end with the character sequence --->. A legal XML comment ends with -->— that is, two dashes and a greater than character.
If a reference to an entity is present in an XML document and any of the following are true, any entity referenced must be declared:
There is no Document Type Definition (DTD).
A document has only an internal DTD subset with no parameter entity references.
The value of the standalone attribute in the XML ...