/*
  public void treeMerge( BranchNode a, BranchNode b, XMLNode.Externalizer ex,                            XMLNode.Merger nodeMerger )                            throws SAXException, IOException {//$CUT    if( (a != null && ((a.getBaseMatchType() | BranchNode.MATCH_CHILDREN) == 0 )) ||        (b != null && ((b.getBaseMatchType() | BranchNode.MATCH_CHILDREN) == 0 ) ) )      throw new RuntimeException("mergeNode: match type should be match children, otherwise the node should be null!");//$CUT    MergeList mlistA = a != null ? makeMergeList( a ) : null;    MergeList mlistB = b != null ? makeMergeList( b ) : null;    MergePairList merged = null;    pt.enterSubtree(); // Update path tracker to tell where we are...//$CUT//    System.out.println("A = " + a ==null ? "-" : a.getContent().toString());//    System.out.println("B = " + b ==null ? "-" : b.getContent().toString());//    System.out.println("--------------------------");/*  if( mlistA.getEntryCount() > 30 )      debug=1;*//*    if(debug>=0 ) {      System.out.println("#########################################Merge A list");      if( mlistA != null )        mlistA.print();      else        System.out.println("--none--");      System.out.println("Merge B list");      if( mlistB != null )        mlistB.print();      else        System.out.println("--none--");      debug =0;    }*///$CUT    // Generate merge pair List, store in the merged object    if( mlistA != null && mlistB != null )      merged = makeMergePairList( mlistA, mlistB ); // Merge lists    else      // Only one child list, construct mergepairllist directly from child mlist      merged = mergeListToPairList( mlistA == null ? mlistB : mlistA, null );//$CUT/*    if( debug>=0) {      System.out.println("#########################################MERGED LIST");      merged.print();    }*///$CUT    // Handle updates & Recurse    for( int i=0;i<merged.getPairCount();i++) {      MergePair mergePair = merged.getPair(i);      XMLNode mergedNode = mergeNodeContent( mergePair, nodeMerger );      if( mergedNode instanceof XMLTextNode ) {        XMLTextNode text = (XMLTextNode) mergedNode;        ex.startNode(text);        ex.endNode(text);        // NOTE: Theoretically, if we have matched text and element nodes we        // need to recurse here. But, the current matching algo never matches        // across types, so there's no need for recursion      } else {        // It's an element node        XMLNode mergedElement = mergedNode;        ex.startNode(mergedElement);        // Figure out partners for recurse        MergePair recursionPartners = getRecursionPartners( mergePair );        // Recurse for subtrees        treeMerge(recursionPartners.getFirstNode(),                  recursionPartners.getSecondNode(),ex,nodeMerger);        ex.endNode(mergedElement);      }      pt.nextChild();    }    pt.exitSubtree();  }