def METHOD_NAME():
    parser = _create_parser()
    raw_args = parser.parse_args()
    args = _validator_args_logic(args=raw_args)
    # auto generate an output path if one was not given
    if args.output_path is None:
        args.output_path = get_xml_path(args.path_to_XLSForm)
    if args.json:
        # Store everything in a list just in case the user wants to output
        # as a JSON encoded string.
        response = {"code": None, "message": None, "warnings": []}
        try:
            response["warnings"] = xls2xform_convert(
                xlsform_path=args.path_to_XLSForm,
                xform_path=args.output_path,
                validate=args.odk_validate,
                pretty_print=args.pretty_print,
                enketo=args.enketo_validate,
            )
            response["code"] = 100
            response["message"] = "Ok!"
            if response["warnings"]:
                response["code"] = 101
                response["message"] = "Ok with warnings."
        except Exception as e:
            # Catch the exception by default.
            response["code"] = 999
            response["message"] = str(e)
        logger.info(json.dumps(response))
    else:
        try:
            warnings = xls2xform_convert(
                xlsform_path=args.path_to_XLSForm,
                xform_path=args.output_path,
                validate=args.odk_validate,
                pretty_print=args.pretty_print,
                enketo=args.enketo_validate,
            )
        except EnvironmentError as e:
            # Do not crash if 'java' not installed
            logger.error(e)
        except ODKValidateError as e:
            # Remove output file if there is an error
            os.remove(args.output_path)
            logger.error(e)
        else:
            if len(warnings) > 0:
                logger.warning("Warnings:")
            for w in warnings:
                logger.warning(w)
            logger.info("Conversion complete!")