Patent ID: 7149966

Claim:
A computer-readable medium encoded with computer-executable components, comprising: a word processor configured to provide a freestyle-editing environment for editing an XML document comprising a first tag pair and a second tag pair, the freestyle-editing enviromnent enabling free editing of the XML document; and an XML well-formedness monitor associated with the word processor, the XML well-formedness monitor being configured to: determine if the XML document violates a tag-nesting rule, wherein the tag-nesting rule requires that the first tag pair is entirely contained within the second tag pair, determine a priority established between the first tag pair and the second tag pair based on whether the tag pair is a normal XML tag pair or a native XML tag pair, and automatically execute a correction rule to restore the well-formedness of the XML document when the XML document contains a tag-nesting rule violation, wherein the correction rule is executed by moving one tag in the tag pair that is associated with a higher priority such that the first tag pair is entirely contained within the second tag pair.