code: def leaf_node_to_text(leaf_node: DagNode) -> str:
      """Converts the dag starting from the given leaf node to a text representation.
  
      The text representation is similar to XML.
      """
      return MetricFlowDagToText().to_text(leaf_node)
  
file_path: metricflow/metricflow/dag/dag_to_text.py
imports: from __future__ import annotations
  import logging
  import textwrap
  from typing import TypeVar
  import jinja2
  from dbt_semantic_interfaces.pretty_print import pformat_big_objects
  from metricflow.dag.mf_dag import DagNode, DagNodeVisitor, MetricFlowDag
label_desc: Use image node_id 1 for calling a global function with example usage: leaf_node_to_text(leaf_node) and returns: MetricFlowDagToText