def merge_properties(previous_val, next_val):
    """
    Function used in reduce for merging several xml properties to dict
    Example:
        Source: [
                    {"name": "name", "value": "cache_name"},
                    {"name": "groupName", "value": "group_name"}
                ]
        Result: {
                    "name": "cache_name",
                    "groupName": "group_name"
                }
    :param previous_val:    reduce previous value
    :param next_val:        next value
    :return:                properties dict
    """
    if previous_val["name"] == 'name':
        previous_val["name"] = previous_val["value"]
        del previous_val["value"]
    previous_val[next_val["name"]] = next_val.get("value", next_val["_children"])
    return previous_val