Parts of an XML Document

An XML document is a relatively simple item that is made up of few building blocks. This format has been recommended as a web standard in order for an XML document to be Valid.  Below are the components of an XML document.

•   Prolog (optional)

XML Declaration

Document Type Declarations (DTD)

•   Root Element

Nested Elements

Attributes and Values



Prolog – The prolog is optional and contains the XML declaration and the DTD.

XML Declaration – states the version of XML that is being used.

DTD – Determines the rules that the XML document must follow. A more detailed lesson on DTDs will be visited later in this tutorial.

Root Element – Is the first element in the XML document and states the kind of XML document that it is. There can only be one root element.

Elements and – These represent the different types of data being stored in the XML document.

Attributes – Like HTML attributes, XML attributes have a name-value relationship.

Data – This is the content of the XML file and it appears between the open and closing tags of the elements.

This entry was posted in XML Tutorial. Bookmark the permalink.

Leave a Reply

Your email address will not be published.