Decorator used to declare that the setter function is an attribute of embedded tag

def tag_value_setter(tag, attrib):
    """
    Decorator used to declare that the setter function is an attribute of embedded tag
    """
    def outer(func):
        def inner(self, value):
            tag_elem = self.et.find(tag)

            if tag_elem is None:
                et = ElementTree.fromstring("<{}></{}>".format(tag, tag))
                self.et.append(et)
                tag_elem = self.et.find(tag)

            tag_elem.attrib[attrib] = str(value)
        return inner
    return outer