code: public String transform(Element formulaNode) throws Exception, MathConverterException {
          // 1a. consolidate on the default mathml namespace
          formulaNode = consolidateMathMLNamespace(formulaNode);
          // 1b. scan the inner content format
          Content content = scanFormulaNode(formulaNode);
  
          String rawMathML;
          if (content == Content.pmml || content == Content.cmml || content == Content.mathml) {
              // 2a. grab the "math" root element
              Element mathEle = grabMathElement(formulaNode);
              formulaId = mathEle.getAttribute("id");
              if (formulaId.equals("")) {
                  try {
                      Element applyNode = (Element) XMLHelper.getElementB(formulaNode, xPath.compile("//m:apply"));
                      formulaId = applyNode.getAttribute("id");
                  } catch (Exception e) {
                      logger.trace("can not find apply node ", e);
                  }
              }
              formulaName = mathEle.getAttribute("name");
              // 2b. try to bring the content into our desired well formatted mathml
              rawMathML = transformMML(mathEle, content);
          } else if (content == Content.latex) {
              // 3a. per default we try to convert it via LaTeXML
              rawMathML = convertLatex(formulaNode.getTextContent());
          } else {
              throw new MathConverterException("formula contains unknown or not recognized content");
          }
  
          // 4. canonicalize and verify the mathml output
          return verifyMathML(canonicalize(rawMathML));
      }
docs: This method will scan the formula node, extract necessary information
  and transform is into a well formatted MathML string containing the
  desired pMML and cMML semantics.
  
  @param formulaNode formula node to be inspected and transformed.
  @return MathML string
  @throws Exception              fatal error in the process
  @throws MathConverterException transformation process failed