Patent ID: 8473506

Claim:
A computer-implemented method comprising: storing elements that describe element instances that can occur in a collection of XML documents; wherein said collection of XML documents includes a particular XML document that contains document element instances, each element instance of said document element instances being an instance of an element of said elements; wherein each element of said elements defines a respective plurality of states; wherein for each element instance of said document element instances, each state of the respective plurality of states defined by the element, of which the element instance is an instance, is active or inactive at a particular point in time and describes: one or more element constraints; or one or more formulae for calculating element values; and validating an XML document against the elements, wherein validating the XML document includes: for a particular element of said elements of which there is a particular element instance in said XML document, determining that a particular state from among a plurality of states defined by said particular element is active; and in response to determining that the particular state is active, validating the particular element instance according to any constraints and formulae described by the particular state.