To be well formed:
• The file must begin with the XML declaration.
• The document must have a root element.
• All elements (tags) must have a closing tag.
• Tags are case-sensitive.
• The elements must be properly nested.
• Attribute values must be quoted.
To be valid, an XML document must conform to the rules of a DTD or schema that defines the structure of the document (for example, the order of tags, the number of tags allowed of a certain type, the type of tag content accepted, etc.).
The following rules apply to tags:
• A tag must not contain extra whitespace (this will be included as the value). For example:
<organizationCode> MOTR </organizationCode> needs to be formatted as: <organizationCode>MOTR</organizationCode>
• Tags should not be empty. If the field is not required, do not render the tag element. For example:
<organizationCode></organizationCode> will cause an error.
Warning: Watch out for invalid XML characters. Any character that is used in markup must be within a CDATA block if used inside a tag. A CDATA block starts with <![CDATA [and ends with ]]>. Any text inside the CDATA block will not be parsed as possible markup. Some characters that often cause problems are: &, !, <, [, and ].