For an XML document to be considered valid, it must satisfy the following restrictions:
The document must have only one top-level element. This element is called the root element.
Every element must have both a start and an end tag.
All attributes must have values, and those values must be quoted.
Elements must not overlap. You cannot use
</a> tag comes before
You must convert &, <, and > to their entity equivalents.
You can use
htmlentities( ) to
When a document meets these rules, it’s valid, or well-formed, XML.