<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _make_attr_element_from_resourceattr(parent, resource_attr_i):
 """ General function to add an attribute element to a resource element. """


    attr = _make_attr_element(parent, resource_attr_i.attr)

    attr_is_var    = etree.SubElement(attr, 'is_var')
    attr_is_var.text = resource_attr_i.attr_is_var

    return attr