import copy


def _update_inner_xml_ele(ele, list_):
    """Copies an XML element, populates sub-elements from `list_`

    Returns a copy of the element with the subelements given via list_
    :param ele: XML element to be copied, modified
    :type ele: :class:`xml.ElementTree.Element`
    :param list list_: List of subelements to append to `ele`
    :returns: XML element with new subelements from `list_`
    :rtype: :class:`xml.ElementTree.Element`
    """
    ret = copy.copy(ele)
    for i, v in enumerate(list_):
        ret[i] = v
    return ret