Many data on the Web are XML documents. An XML document is an unranked labelled tree. A schema for XML documents (for instance a DTD) is the specification of their internal structure: a schema is a tree grammar, and validating a document w.r.t. a schema is done by a running of a tree automaton. Given a document, valid w.r.t. a DTD, and a sequence of updates (insertions, deletions and replacements of subtrees), we first recall how we incrementally check the validity of the resulting document. Indeed, updating a valid document requires re-checking the parts of the document concerned by the updates. Next, the core of the paper is a method to correct subtrees for which the re-validation fails: if the validator fails at node p, a correction routine is called in order to compute corrections of the subtree rooted at p, within a given threshold. Then re-validation continues. When the tree traversal is completed (i.e. all updates have been considered), the corrections generated by each call to ...