code: private static MathNode createMathNode(Node node, int depth) {
          MathNode mathNode = new MathNode();
          mathNode.setName(node.getNodeName());
          if (mathNode.getName().equalsIgnoreCase("annotation-xml")) {
              // this can be an additional tag from the strict cmml conversion
              // - node should not used.
              return null;
          }
          mathNode.setAttributes(node.getAttributes());
          // read the value / symbol of the current node. TODO this can maybe done in a better way
          mathNode.setValue(node.getFirstChild() != null ? node.getFirstChild().getTextContent().trim() : node.getTextContent().trim());
          mathNode.setDepth(depth);
          // iterate over all child elements - recursion
          XMLUtils.getChildElements(node).forEach(c -> mathNode.addChild(createMathNode(c, depth + 1)));
          return mathNode;
      }
docs: Recursive method to create a math expression tree (MEXT). Every child
  and all attributes are considered in the conversion.
  
  @param node  current xml node in cmml, typically the root element
  @param depth current depth of the math tree
  @return converted MathNode we use in this application