⟩ Tell us what is the purpose of a document schema?
The schema is basically a contract of your message and defines it. The XML Schema definition (XSD) language defines the structure of an XML instance message, and this is the intended purpose of XSD, such schemas use XSD in a straightforward way.
A schema is a term borrowed from the database world to describe the structure of data in relational tables. In the context of XML, a schema describes a model for a whole class of documents.