def get_affiliation_countries(xml_root):
    """
    Returns a list of 2-letter country codes that Cermine found in the affiliations. This function
    just looks at the Cermine XML and extracts these country codes when they are present.
    :param xml_root: root of xml parse
    :return: a list of country codes listed in affiliations; list may be empty
    """
    countries = []
    for contrib_group in xml_root.iter('contrib-group'):
        for contrib_child in contrib_group:
            if contrib_child.tag == 'aff':
                for aff_child in contrib_child:
                    if aff_child.tag == 'country':
                        if 'country' in aff_child.attrib:
                            country = aff_child.attrib['country']
                            countries.append(country)
    return countries