code: private void buildNode(MessageMLParser context, org.w3c.dom.Node node) throws InvalidInputException, ProcessingException {
      switch (node.getNodeType()) {
        case org.w3c.dom.Node.TEXT_NODE:
          buildText((Text) node);
          break;
  
        case org.w3c.dom.Node.ELEMENT_NODE:
          buildElement(context, (org.w3c.dom.Element) node);
          break;
  
        default:
          throw new InvalidInputException("Invalid element \"" + node.getNodeName() + "\"");
  
      }
    }
docs: Build a text node or a MessageML element based on the provided DOM node.