XML schemas define the structure, content, data types, and elements allowed in an associated XML document. They also describe the semantic-processing instructions associated with the elements contained in the document. The XML schema is embodied in an XML Schema Definition (XSD) file, itself an XML document. XML schemas are used when you are building a web service based on a Java CAPS Collaboration Definition (Java).