def find_elem(xml_platform, type_name, elem_name):
    """
    Find an element of a certain type in the platform.
    :param xml_platform: platform to search in
    :param type_name:    type of the element to be found
    :param elem_name:    name of the element to be found
    """
    get_type_elems = getattr(xml_platform, "get_" + type_name)
    for elem in get_type_elems():
        if elem.get_id() == elem_name:
            return elem
    raise RuntimeError("%s %s was not defined", type_name, elem_name)