def _get_single_element_by_id(api, type_, id_, recurse_down=True):
    """ Retrieves a single OpenStreetMap element by its id.

      api - an initialised Overpass API object
      type_ - the element type to query, one of node, way or relation
      id_ - the id of the element to retrieve
      recurse_down - whether to get child nodes of ways and relations
    """
    query = '%s(%d);%s' % (type_, id_, '(._;>;);' if recurse_down else '')
    result = api.Get(query, responseformat='xml')
    return result
