def contains_language(key, language):
    """ Checks whether a given key contains a certain language. """
    for child in key.childNodes:
        try:
            assert(child.tagName == language)
            return True
        except:
            pass

    return False