*/
  protected void treeMerge( BranchNode a, BranchNode b, ContentHandler ch ) throws SAXException {    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!");    MergeList mlistA = a != null ? makeMergeList( a ) : null;    MergeList mlistB = b != null ? makeMergeList( b ) : null;    MergePairList merged = null;    pt.enterSubtree();//    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 || mlistA.getEntryCount()>40) {    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--");    }    // Generate merge pair List    if( mlistA != null && mlistB != null )      merged = makeMergePairList( mlistA, mlistB ); // Merge lists    else      merged = mergeListToPairList( mlistA == null ? mlistB : mlistA, null );    // Now, the merged list is in merged    // Handle updates & Recurse    for( int i=0;i<merged.getPairCount();i++) {      MergePair mergePair = merged.getPair(i);      XMLNode mergedNode = mergeNodeContent( mergePair );      if( mergedNode instanceof XMLTextNode ) {        XMLTextNode text = (XMLTextNode) mergedNode;        ch.characters(text.getText(),0,text.getText().length);      } else {        // It's an element node        XMLElementNode mergedElement = (XMLElementNode) mergedNode;        ch.startElement(mergedElement.getNamespaceURI(),mergedElement.getLocalName(),mergedElement.getQName(),mergedElement.getAttributes());        // Figure out partners for recurse        MergePair recursionPartners = getRecursionPartners( mergePair );        // Recurse!        treeMerge(recursionPartners.getFirstNode(),recursionPartners.getSecondNode(),ch);        ch.endElement(mergedElement.getNamespaceURI(),mergedElement.getLocalName(),mergedElement.getQName());      }      pt.nextChild();    }    pt.exitSubtree();  }