19. A system according to claim 13 , wherein data structures are maintained, said data structures designed to enable efficient monitoring as the XML document changes and holding information relevant to the validation of key, keyref and unique constraints.
13. A system for updating an XML document in a computer and validating the update in an incremental fashion with respect to XML schema key and keyref constraints, said system comprising: (i) an XML schema comprising key and keyref constraints, wherein each keyref constraint refers to a key constraint in a scoping element, by specifying the key constraint's name; (ii) an XML document validated as conforming to the XML schema and comprising a key element and a keyref element in accordance with the key and keyref constraints; (iii) a data structure for capturing the state of the XML document with respect to key and keyref constraints to enable efficient monitoring as the XML document changes; (iv) an update, including one or more operations, to be made to the XML document; (v) means for determining based on the data structure, specified update and relevant key or keyref constraints the parts of the XML document that may be affected by said update; (vi) means for verifying by scanning only the parts of the XML documents determined in (v) that said update does not violate any key or keyref constraints; and (vii) means for performing said update only after the verification of (vi) is successful; and (viii) means for updating the data structure with the update information.