def find_settings(element, alternate_name):
    """Given an ElementTree.Element and a string, searches the element for 
    a subelement called "settings". If it doesn't find it, searches for
    a subelement using the alternate_name.

    Prior to Vespa 0.7.0, the settings in Analysis blocks had unique class 
    and XML tag names, e.g. BlockSpectralSettings/block_spectral_settings.
    As of 0.7.0, they're all just called "settings". This function finds
    whichever of the two is present.
    """
    # First search under the preferred name.
    settings_element = element.find("settings")

    if settings_element is None:
        settings_element = element.find(alternate_name)

    return settings_element