def get_header_version(args, dat_root, parser):
    """Return the version from the <dat_root> header version, or the -header_version argument"""
    if not args.header_version:
        header_version = dat_root.find('header').find('version').text
        if not header_version:
            print('Version not found in ClrMame Pro XML dat. Please specify with -header_version')
            print('')
            parser.print_help()
            parser.exit()
            raise SystemExit()
    else:
        header_version = args.header_version
    return header_version