I am in the very early stages of writing XML schema for my work's enterprise application. The XML to be validated represents an application - similar to Winforms - forms, grids, menus etc but without layout.
The prime purpose of the XSD is not so much to validate the XML but to add design-time discoverability to the XML file, so that one would get IntelliSense for available elements and attributes.
As I am writing up the schema I have found myself doing elements of TDD and validating a document against the schema, changing either elements/attributes in the document or in the schema to make validation fail to make sure I am writing the schema correctly.
This brings me to the question of whether or not I should be unit-testing the schema, just to throw a few permutations of the XML at it and make sure it behaves how it's supposed to.
It would certainly make sense to me as my XSD-fu is abysmal and I want to be even more sure the XSD, which in effect IS a specification by itself, is correct.