code: public boolean acceptDFVisitor(NodeVisitor nv) throws Exception {
      Node currNode;
      boolean continueVisit = true;
  
      if (nv != null) {
        if (isLeaf()) {
          continueVisit = nv.visit(this);
        } else {
          continueVisit = nv.visitBegin(this);
          if (continueVisit) {
            currNode = getFirstChild();
            do {
              continueVisit = currNode.acceptDFVisitor(nv);
              if (continueVisit) {
                currNode = currNode.getNextSibling();
                if (currNode == getFirstChild()) {
                  break;
                }
                continueVisit = nv.visitMiddle(this);
              }
            } while (continueVisit);
            if (continueVisit) {
              continueVisit = nv.visitEnd(this);
            }
          }
        }
      }
      return continueVisit;
    }
docs: Implements the visitor pattern. This is a Depth-based traversal that will call the INodeVisitor visitBegin(),
  visitMiddle(), and visitEnd() for parent nodes and will call visit() for leaf nodes.
  
  @param nv INodeVisitor to call upon reaching a node when traversing the tree.
  @see NodeVisitor