code: def generate_doxygen_xml(app: Sphinx) -> None:
      """Generate XML documentation for C API by Doxygen.
  
      Parameters
      ----------
      app : sphinx.application.Sphinx
          The application object representing the Sphinx process.
      """
      doxygen_args = [
          f"INPUT={CURR_PATH.parent / 'include' / 'LightGBM' / 'c_api.h'}",
          f"OUTPUT_DIRECTORY={CURR_PATH / 'doxyoutput'}",
          "GENERATE_HTML=NO",
          "GENERATE_LATEX=NO",
          "GENERATE_XML=YES",
          "XML_OUTPUT=xml",
          "XML_PROGRAMLISTING=YES",
          r'ALIASES="rst=\verbatim embed:rst:leading-asterisk"',
          r'ALIASES+="endrst=\endverbatim"',
          "ENABLE_PREPROCESSING=YES",
          "MACRO_EXPANSION=YES",
          "EXPAND_ONLY_PREDEF=NO",
          "SKIP_FUNCTION_MACROS=NO",
          "PREDEFINED=__cplusplus",
          "SORT_BRIEF_DOCS=YES",
          "WARN_AS_ERROR=YES",
      ]
      doxygen_input = "\n".join(doxygen_args)
      doxygen_input = bytes(doxygen_input, "utf-8")
      (CURR_PATH / "doxyoutput").mkdir(parents=True, exist_ok=True)
      try:
          # Warning! The following code can cause buffer overflows on RTD.
          # Consider suppressing output completely if RTD project silently fails.
          # Refer to https://github.com/svenevs/exhale
          # /blob/fe7644829057af622e467bb529db6c03a830da99/exhale/deploy.py#L99-L111
          process = Popen(
              ["doxygen", "-"], stdin=PIPE, stdout=PIPE, stderr=PIPE
          )
          stdout, stderr = process.communicate(doxygen_input)
          output = "\n".join(
              [
                  i.decode("utf-8")
                  for i in (stdout, stderr)
                  if i is not None
              ]
          )
          if process.returncode != 0:
              raise RuntimeError(output)
          else:
              print(output)
      except BaseException as e:
          raise Exception(
              f"An error has occurred while executing Doxygen\n{e}"
          )
  
imports: import datetime
  import os
  import sys
  from pathlib import Path
  from re import compile
  from shutil import copytree
  from subprocess import PIPE, Popen
  from typing import Any, List
  import sphinx
  from docutils.nodes import reference
  from docutils.parsers.rst import Directive
  from docutils.transforms import Transform
  from sphinx.application import Sphinx
  from sphinx.errors import VersionRequirementError
label_desc: Use image node_id 1 for calling a global function with example usage: generate_doxygen_xml(app) without return types