I've been implementing the new facility in XML Schema 1.1 for defining assertions, in terms of XPath expressions. It's a great feature. You could do something similar before, of course, using Schematron - but no-one really wants to do to separate validations using very different technologies. The new xs:assert clause makes it all much more seamless. As one might expect in a first draft though, there are glitches in the spec.   more »