code: public static String printMathNode(MathNode node, String indent) {
          StringBuilder sb = new StringBuilder(indent + node.toString() + "\n");
          node.getChildren().forEach(n -> sb.append(printMathNode(n, indent + " ")));
          return sb.toString();
      }
docs: Converts a MathNode into a an simplistic indented tree
  representation of itself.
  
  @param node   Node to begin with and onwards for all children of it.
  @param indent starting line used as an indent (e.g. start with "")
  @return return a tree representation of itself