1. A method for updating an XML document and validating the update in an incremental fashion with respect to XML schema key and keyref constraints, said method comprising: (i) defining an XML schema comprising key and keyref constraints; (ii) validating an XML document conforming to the XML schema and comprising a key element and a keyref element in accordance with the key and keyref constraints; (iii) specifying an update, including one or more operations, to be made to the XML document; (iv) verifying that said update does not violate any key or keyref constraints; and (v) performing said update only after the verification of (iv) is successful.