Writes an opening element.

    :name: the name of the element
    :attrs: a dict of attributes
    :close: if True, close will be called immediately after writing the element

def open(self, name, attrs=None, *, close=False):
    """Writes an opening element.

    :name: the name of the element
    :attrs: a dict of attributes
    :close: if True, close will be called immediately after writing the element
    """
    self._pad()
    self._writer.startElement(_normalize_name(name), _normalize_attrs(attrs))
    self._newline()
    self._open_elements.append(name)

    if close:
      self.close()