An XML schema is a document that defines the valid content of XML files. An XML schema file, like a DTD file, contains only metadata. An XML schema defines the structure and type of elements and attributes for an associated XML file. When you use a schema to define an XML file, you can restrict data, define data formats, and convert data between datatypes. An XML schema supports complex types and inheritance between types. A schema provides a way to specify element and attribute groups, ANY content, and circular references.