code: def _elem_set_attrs(obj, parent, to_str):
      
      for attr, val in anyconfig.compat.iteritems(obj):
          parent.set(attr, to_str(val))
docs: :param obj: Container instance gives attributes of XML Element
      :param parent: XML ElementTree parent node object
      :param to_str: Callable to convert value to string or None
      :param options: Keyword options, see :func:`container_to_etree`
  
      :return: None but parent will be modified