code: String verifyMathML(String canMathML) throws MathConverterException {
          try {
              Document tempDoc = XMLHelper.string2Doc(canMathML, true);
              Content content = scanFormulaNode((Element) tempDoc.getFirstChild());
              //verify the formula
              if (content == Content.mathml) {
                  return canMathML;
              } else {
                  throw new MathConverterException("could not verify produced mathml, content was: " + content.name());
              }
          } catch (Exception e) {
              logger.error("could not verify mathml", e);
              throw new MathConverterException("could not verify mathml");
          }
      }
docs: Just a quick scan over.
  
  @param canMathML final mathml to be inspected
  @return returns input string
  @throws MathConverterException if it is not a well-structured mathml