f = function(field, fn)
        {
            // if the field has children, go depth first
            if (field.children && field.children.length > 0)
            {
                for (var i = 0; i < field.children.length; i++)
                {
                    fn(field.children[i]);
                }
            }
        }
Runs the given function over the field and all of its children recursively.

@param field
@param fn