An XML Schema is an XML-based language used to describe the structure, content, and semantics of an XML document. It defines the building blocks of an XML document, effectively defining a class of XML documents of a given type, for example, purchase orders. It provides a means to define custom data types, elements, and attributes, and enforce rules to validate an XML document against a schema.