1. A method for determining and applying rules to data, the method comprising: receiving data comprising a root element and at least one leaf element, the root element having attributes, the attributes comprising characteristics; selecting a condition table based on the characteristics; selecting a first ruleset based on the selected condition table; and applying rules defined by the selected first ruleset to the data.