An XML document should start with a header such as
<?xml version="1.0" encoding="UTF-8"?>
Strictly speaking, a header is optional, but it is highly recommended.
Since SGML was created for processing of real documents, XML files are called documents even though many of them describe data sets that one would not normally call documents.
The header can be followed by a document type definition (DTD), such as
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">