code: protected void compareNode(Node control, Node test,
                                 DifferenceListener listener, ElementQualifier elementQualifier) 
          throws DifferenceFoundException {
          boolean comparable = compareNodeBasics(control, test, listener);
          boolean isDocumentNode = false;
  
          if (comparable) {
              switch (control.getNodeType()) {
              case Node.ELEMENT_NODE:
                  compareElement((Element)control, (Element)test, listener);
                  break;
              case Node.CDATA_SECTION_NODE:
              case Node.TEXT_NODE:
                  compareText((CharacterData) control,
                              (CharacterData) test, listener);
                  break;
              case Node.COMMENT_NODE:
                  compareComment((Comment)control, (Comment)test, listener);
                  break;
              case Node.DOCUMENT_TYPE_NODE:
                  compareDocumentType((DocumentType)control,
                                      (DocumentType)test, listener);
                  break;
              case Node.PROCESSING_INSTRUCTION_NODE:
                  compareProcessingInstruction((ProcessingInstruction)control,
                                               (ProcessingInstruction)test, listener);
                  break;
              case Node.DOCUMENT_NODE:
                  isDocumentNode = true;
                  compareDocument((Document)control, (Document) test, 
                                  listener, elementQualifier);
                  break;
              default:
                  listener.skippedComparison(control, test);
              }
          } 
  
          compareHasChildNodes(control, test, listener);
          if (isDocumentNode) {
              Element controlElement = ((Document)control).getDocumentElement();
              Element testElement = ((Document)test).getDocumentElement();
              if (controlElement!=null && testElement!=null) {
                  compareNode(controlElement, testElement, listener, elementQualifier);
              }
          } else {
              controlTracker.indent();
              testTracker.indent();
              compareNodeChildren(control, test, listener, elementQualifier);
              controlTracker.outdent();
              testTracker.outdent();
          }
      }
docs: First point of call: if nodes are comparable it compares node values then
  recurses to compare node children.
  @param control
  @param test
  @param listener
  @param elementQualifier
  @throws DifferenceFoundException