<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_element_with_atts_to_etree(self, etree, name, atts):
 """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 """

        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)