Updates and returns the updated complex Element parsed from tree_to_update.
    :param tree_to_update: the XML tree compatible with element_utils to be updated
    :param xpath_root: the XPATH location of the root of the complex Element
    :param xpath_map: a Dictionary of XPATHs corresponding to the complex structure definition
    :param prop: the property identifying the complex structure to be serialized
    :param values: a Dictionary representing the complex structure to be updated

def update_complex(tree_to_update, xpath_root, xpath_map, prop, values):
    """
    Updates and returns the updated complex Element parsed from tree_to_update.
    :param tree_to_update: the XML tree compatible with element_utils to be updated
    :param xpath_root: the XPATH location of the root of the complex Element
    :param xpath_map: a Dictionary of XPATHs corresponding to the complex structure definition
    :param prop: the property identifying the complex structure to be serialized
    :param values: a Dictionary representing the complex structure to be updated
    """

    remove_element(tree_to_update, xpath_root, True)

    values = reduce_value(values, {})

    if not values:
        # Returns the elements corresponding to property removed from the tree
        updated = update_property(tree_to_update, xpath_root, xpath_root, prop, values)
    else:
        for subprop, value in iteritems(values):
            xpath = xpath_map[subprop]
            value = get_default_for_complex_sub(prop, subprop, value, xpath)
            update_property(tree_to_update, None, xpath, subprop, value)
        updated = get_element(tree_to_update, xpath_root)

    return updated