'Convert Validated object to a dictionary.
Recursively traverses all of its elements and converts everything to
simplified collections.
Returns:
A dict of all attributes defined in this classes ATTRIBUTES mapped
to its value.  This structure is recursive in that Validated objects
that are referenced by this object and in lists are also converted to
dicts.'

def ToDict(self):

    result = {}
    for (name, validator) in self.ATTRIBUTES.iteritems():
        value = getattr(self, name)
        if (not (isinstance(validator, Validator) and (value == validator.default))):
            result[name] = _SimplifiedValue(validator, value)
    return result
