The primary reason for defining an XML schema is to formally describe an XML document; however the resulting schema has a number of other uses that go beyond simple validation.
The schema can be used to generate code, referred to as XML Data Binding.