def load(attr, element, default=None):
    """
    Helper function for loading XML attributes with defaults.
    """
    if not element in attr.__dict__:
        return default

    return attr[element]