BranchNode nc = new BranchNode( n.getContent() );
BranchNode nc = new BranchNode( (XMLNode) n.getContent().clone() );
  protected BranchNode clonedAndMatchedTree( Node n, boolean left, boolean resetMatches ) {    BaseNode b = n instanceof BaseNode ? (BaseNode) n : ((BranchNode) n).getBaseMatch();    BranchNode nc = new BranchNode( n.getContent() );    if( b != null ) { // Set matches for non-inserted nodes      nc.setBaseMatch(b,BranchNode.MATCH_FULL);      MatchedNodes mn = left ? b.getLeft() : b.getRight();      if( resetMatches )        mn.clearMatches();      mn.addMatch(nc);    }    for( int i=0;i<n.getChildCount();i++)      nc.addChild(clonedAndMatchedTree(n.getChildAsNode(i),left,resetMatches));    return nc;  }