'Convert ValidatedBase object to a dictionary.
Recursively traverses all of its elements and converts everything to
simplified collections.
Subclasses should override this method.
Returns:
A dictionary mapping all attributes to simple values or collections.'

def ToDict(self):

    result = {}
    for (name, value) in self.iteritems():
        validator = self.GetValidator(name)
        result[name] = _SimplifiedValue(validator, value)
    return result
