'A convenience method for creating wrapper elements using the
``with`` statement.
Examples
>>> with writer.tag(\'foo\'):  # doctest: +SKIP
...     writer.element(\'bar\')
... # </foo> is implicitly closed here
Parameters are the same as to `start`.'

@contextlib.contextmanager
def tag(self, tag, attrib={}, **extra):

    self.start(tag, attrib, **extra)
    (yield)
    self.end(tag)
