for(int i=0;i<base.getChildCount();i++) setMatchTypes(base.getChild(i));
  private void setMatchTypes( ONode base ) {//    System.out.println("SMT: " + base.toString());    getFirstMapping(base);    if( getNextMapping() != null ) {      // The node is copied, we must resolve main copies as well as child/structmatches      // 1st task: find main copy      ONode copy = getFirstMapping(base), master=null;      boolean search = true;      double clmin = 1e+99;      // First candidate is perfect clist && match, second best possible clist.      while( copy != null && search) {//        System.out.println("Loop1");        double clmatch = childListDist(copy,base);        if( matches(copy,base) && clmatch<1e-09 ) {          master = copy;          search = false; // Fund a suitable master        } else if( clmatch<clmin ) {          master=copy;          clmin = clmatch;        }        copy = getNextMapping();      }      // POSSIBLE ACTION here: if clist is baad, then remove the mapping altogether.      copy = getFirstMapping(base);      Set removed = new HashSet();      while( copy != null ) {//        System.out.println("Loop2");        if( copy != master ) {          boolean structMatch = exactChildListMatch(master,copy);          boolean contMatch =  matches( master, copy );          if( !structMatch && !contMatch)            removed.add(copy);          else            copy.matchType = (contMatch ? BranchNode.MATCH_CONTENT : 0) +                            (structMatch ? BranchNode.MATCH_CHILDREN : 0);          System.out.println("MTYPE="+copy.matchType+" for "+copy.toString());        }        copy = getNextMapping();      }      for( Iterator i=removed.iterator();i.hasNext();) {        ONode n = (ONode) i.next();       delMatching(base,n );       delMatching(n,base );      }    } // if copy    for(int i=0;i<base.getChildCount();i++)      setMatchTypes(base.getChild(i));  }