code: def tree_to_html(tree: Branch) -> ET.Element:
      def add_node(node: Branch | Leaf, parent: ET.Element):
          # We're building this:
          #
          # <li>
          #   <pre>Split information</pre>
          #   <ul>...</ul
          # <li>
  
          li = ET.Element("li")
          parent.append(li)  # type: ignore
  
          code = ET.Element("code")
  
          if isinstance(node, Branch):
              code.text = node.repr_split
              li.append(code)
  
              ul = ET.Element("ul")
  
              for child in node.children:
                  add_node(node=child, parent=ul)
  
              li.append(ul)
  
          else:
              code.text = repr(node)
              li.append(code)
  
      root = ET.Element("ul", attrib={"class": "tree"})
      add_node(node=tree, parent=root)
  
      return root
  
label_desc: Use image node_id 1 for calling a global function with example usage: tree_to_html(tree) and returns: root