1. Well-Formed XML Documents
A “well-formed” XML document means that document has the correct XML
syntax.
The XML document that follows XML grammar rules is called well-formed document. A document that includes a sequence of markup characters that cannot be parsed or are invalid cannot be well-formed. The following points are to be kept in mind for a valid XML document:
1. The document must contain at least one element

2. The document must have a root element
A root element is a unique element in the XML document, which contains the complete document.

3. The element must have the opening and the closing tags
To close a tag, you need to prefix the forward slash with the normal tag.
e.g.

4. XML tags must be closed properly
There must be a proper closing tag. In XML, empty tags must end with the following slash.
e.g.

5. XML elements must be properly nested
The parent element has to be opened before the child element and closed after the child element.

This code is not well-formed because the root element (College) is closed before the parent element (Student).
6. XML tags are case sensitive
XML tags are case sensitive means the opening and ending tags must be in the same case.
e.g.

7. XML attribute values should be in double quotation marks
The attribute value in an XML document should be enclosed in proper quotes.
e.g.

2. Valid XML Document
A valid XML document is .not only a well-formed document but as well as they also checked error against a DTD or schema. DTD is a set of rules that define what tags appear, what value those tags may contain and how the tags are related to each other in an XML document. Validation can be done only if the XML document has valid DTD. When an XML document is checked or parsed according to a particular structure or guidelines, the process is known as validation of the document.