<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_creator(self):
 """ Returns the dict suitable for CreateIdentity or ModifyIdentity """

        o = {}

        for prop in ('name', 'id'):
            if hasattr(self, prop):
                o[prop] = getattr(self, prop)

        try:
            if len(self.a) > 0:
                o['a'] = []
                for node in self._unparse_a_tags(self._a_tags):
                    o['a'].append(node)
        except AttributeError:
            pass
        return o