'Open a grouping element with label *s*. If *gid* is given, use
*gid* as the id of the group.'

def open_group(self, s, gid=None):

    if gid:
        self.writer.start(u'g', id=gid)
    else:
        self._groupd[s] = (self._groupd.get(s, 0) + 1)
        self.writer.start(u'g', id=(u'%s_%d' % (s, self._groupd[s])))
