What is a well-Formed XML document?

A well-formed XML document is a document that conforms to the XML syntax rules, like:

  • it must begin with the XML declaration
  • it must have one unique root element
  • start-tags must have matching end-tags
  • elements are case sensitive
  • all elements must be closed
  • all elements must be properly nested
  • all attribute values must be quoted
  • entities must be used for special characters