1. A method of traversing an input data structure tree representing an input data structure to transform the input data structure to an output data structure according to requirements specified in a transformation template, the input data structure tree being comprised of a root node and plurality of children nodes, each node representing a key in the input data structure and having an associated scope dictionary containing zero or more key-value pairs, the method comprising: receiving a passed scope dictionary; selecting a node in the input data structure tree for processing, the passed scope dictionary being associated with the selected node; and identifying a matching entry in the transformation template for the selected node, the transformation template containing instructions and data for transforming from the input format to the output format that includes one or more entries for keys that may be used in the input data structure; and processing the selected node based on its node type and the matching entry data, including duplicating or modifying the passed scope dictionary based on the node type of the selected node and the matching entry data; wherein the method is performed by one or more processors.