Components of XML documents

Example of an XML document:

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="job.css"?>
<job-posting>
    <title>
    Job Title: Webmaster
    </title>

    <description>
    We are looking for a Webmaster to oversee the management of
    our company website. The Webmaster will be responsible for working
    with other staff members to collect information for the Website, and
    for creating and maintaining the Web pages.
    </description>

    <skills>
    Expected skills:
    <skill>Basic writing skills</skill>
    <skill>Good communication skills</skill>
    <skill>HTML</skill>
    </skills>
</job-posting>

In general, elements act as containers for other pieces of information, including other elements and content. Each element has to have

Exclusion from this rule is empty elements that are used to described pieces of data that don't have any content. Example: <br />.

General element terminology:

child elements
are those that are contained within other elements
parent
are those that contain other elements
siblings
are those that share the same parent element

The root element

The outermost element is called the root element (job-posting in the above example). All other elements and data describe the root element.

XML comments

The syntax for XML comments is the same as for HTML:

<!-- this is a comment -->

Sets of characters

There are three following types of sets of characters in XML documents

parsed data
Set of characters where some characters may have a special meaning for the XML parser, for example the '<' character opens an element tag.
non-parsed data (CDATA)
Set of characters where the special meaning of the characters for the XML parser is ignored. To organize a CDATA section in your document use the following syntax:
<![CDATA[
  . . .
]]>
white space
Character set where every character is either a space, carriage return, tabulation sign, line feed, form feed, etc. Every multiple occurrence of the white space characters is truncated by the XML parser to a single space.