def get_attribute_from_tag(tag, attribute):
    """Returns a xml attribute from a given tag"""
    element = None
    try:
        element = tag.attrib[attribute]
    except KeyError:
        pass
        # print("Error: attribute {} was not defined in this tag.".format(e))
    return element