Two main approaches to defining the format and contents of XML documents are Document Type Definitions (DTDs) and XML schemas. However, before discussing DTDs and XML schemas, let’s discuss the format of an XML document.
XML documents are considered well-formed if they follow the rules in the XML specification regarding document structure. Let’s take a look at some of the more important points related to well-formed documents.
An XML document can only have one root element, that is, the top level of the document tree. For example, in the following XML document, the root element is named <employees>:
<?xml version="1.0" encoding="UTF-8"?> <employees> ...