the primary purpose of a schema language is to specify what the structure of an xml document can be. this means which elements can reside in which other elements, which attributes are and are not legal to have on a particular element, and so forth. a schema is analogous to a grammar for a language; a schema defines what the vocabulary for the language may be and what a valid "sentence" is.