Step 1: A Basic XML File

The minimum requirements for an XML file (according to the W3C XML Recommendation) include an XML declaration, a root element, and well-formedness. An example of a basic XML file is shown below. It does not contain any structural or style rules.


A Basic XML File
A Basic XML File

A Basic XML File Previewed in Internet Explorer.
A Basic XML File Previewed in Internet Explorer
If an XML file does not contain a valid stylesheet processing instruction, Internet Explorer uses its own default stylesheet to display the XML file in an expanding and collapsing tree view. Internet Explorer also checks whether the XML is well-formed. If it is not well-formed Internet Explorer lists the errors onscreen.


What is a 'well-formed' XML Document?

A well-formed XML document obeys the syntax rules of the XML specification. Some of these rules are listed below. By definition, if a document is not well-formed, it is not XML. Therefore, all XML documents are well-formed.

Examples of well-formedness rules include:


Workshop  Workshop