XML Schema is an XML-based alternative to DTDs that defines the structure and legal elements and attributes of an XML document. An XML Schema describes elements, attributes, data types, restrictions, and more. Schemas are more powerful than DTDs and support namespaces, data types, extensibility, and validation of XML documents.