code: def add_element_with_atts_to_etree(self, etree, name, atts):
          
          xml_atts = {}
          for att in atts.keys():
              val = atts[att]
              if (val is not None):
                  xml_atts[self._xml_att_name(att)] = str(val)
          if (len(xml_atts) > 0):
              e = Element(name, xml_atts)
              if (self.pretty_xml):
                  e.tail = "\n"
              etree.append(e)
docs: Add element with name and atts to etree iff there are any atts.
  
          Parameters:
              etree - an etree object
              name  - XML element name
              atts  - dicts of attribute values. Attribute names are transformed