'Represent this group and all its subgroups as string
@param level: the hierarchy level of this group (for indentation)'

def __represent(self, level=0):

    output = ''
    indent = ('    ' * level)
    aggregates = self._aggregates
    for aggregate in aggregates.values():
        output = ('%s\n%s        %s(%s)    =    %s' % (output, indent, aggregate.method, aggregate.key, aggregate.result))
    if aggregates:
        output = ('%s\n' % output)
    key = self.key
    if key:
        for group in self.groups:
            value = group[key]
            if group:
                group_repr = group.__represent(level=(level + 1))
            else:
                group_repr = '[empty    group]'
            output = ('%s\n%s=>    %s:    %s\n%s' % (output, indent, key, value, group_repr))
    else:
        for item in self.items:
            output = ('%s\n%s        %s' % (output, indent, item))
        output = ('%s\n' % output)
    return output
