1. A computer implemented method of editing a set of rules contained in a rules document, said rules defining a transformation of data on an input document, said rules document and said input document having elements constructed in a tree structure having nodes, each said rule on said rules document having a template structure including at least one match condition, said match condition being an expression in said template that describes a subset of tree nodes, said method comprising: selecting at least one rule in said rules document; checking a match condition of said at least one selected rule with said tree nodes from said input document to determine which structures in said input document match said selected rule; merging any rules having an identical effect into a single rule; and presenting a listing by computer implementation of proposed rule modifications based on said determination of matching structures, in order to provide said edited set of rules for use in defining transformation of said input document to produce an output document.