def METHOD_NAME(self, path):
    if not os.path.isfile(path):
        raise DataError(f"Spec file '{path}' does not exist.")
    with ETSource(path) as source:
        root = ET.parse(source).getroot()
    if root.tag != 'keywordspec':
        raise DataError(f"Invalid spec file '{path}'.")
    version = root.get('specversion')
    if version not in ('3', '4', '5', '6'):
        raise DataError(f"Invalid spec file version '{version}'. "
                        f"Supported versions are 3, 4, 5, and 6.")
    return root