XMLElementNode content = new XMLElementNode("editgen:insert",atts);
XMLElementNode content = new XMLElementNode("editgen-insert",atts);
  public boolean editNode( char op, MarkableBaseNode base,MarkableBaseNode baseRoot,                         EditLog mergeLog, EditLog branchLog ) {    BranchNode n = null; // used by edit ops    boolean after = false;    MarkableBaseNode dest = null;    switch(op) {      case 'd': // Delete node        // System.err.println("DEL");        dest = getLargestDelTree(base);        if( dest == null ) {          //System.err.println("-- Nothing suitable to del found");          return false;        }        _checkNotMarked(dest);        dest.lock(MarkableBaseNode.MARK_CONTENT | MarkableBaseNode.MARK_STRUCTURE);        dest.lockSubtree(MarkableBaseNode.MARK_CONTENT | MarkableBaseNode.MARK_STRUCTURE);        delCount++;        editTrees(dest,null,null,false,false,mergeLog,branchLog);        break;      case 'i': // Insert node        insCount++; // System.err.println("INS");        org.xml.sax.helpers.AttributesImpl atts = new org.xml.sax.helpers.AttributesImpl();        atts.addAttribute("","","id","CDATA",                          ""+newId() ); //  rnd.nextLong()+"@"+ System.currentTimeMillis());        XMLElementNode content = new XMLElementNode("editgen:insert",atts);        after = rnd.nextDouble() > 0.5;        base.lock(!after,after,MarkableBaseNode.MARK_STRUCTURE);        editTrees(null,base,new BranchNode( content),after,false,mergeLog,branchLog);        break;      case 'u': // Update node        updateNode(base,mergeLog,branchLog);        updCount++; //System.err.println("UPD");        base.mark(MarkableBaseNode.MARK_CONTENT);        break; // N/A for now...      case 'm': // Move subtree        //System.err.println("MOV");        // Delete from base (src of move) (=delete code block)        base.beginMarkTransaction();        base.lock( MarkableBaseNode.MARK_STRUCTURE);        dest = getRandomNode( baseRoot, MarkableBaseNode.MARK_STRUCTURE, base ); // NOTE! Dest must be fetched AFTER src is locked!        // Check if No possible dest or        // move where a copy of dst is moved        if( dest == null || !_treeHasNoCopyOf(base,dest,true) ) {          base.abortMarkTransaction();          return false; // No possible dest        }        after = rnd.nextDouble() > 0.5;        dest.lock(!after,after,MarkableBaseNode.MARK_STRUCTURE);        // Text node move check        n = dest.getLeft().getFullMatch();        Node n2 = after ? n.getRightSibling() : n.getLeftSibling();        if( base.getContent() instanceof XMLTextNode &&            ( (n.getContent() instanceof XMLTextNode) ||            ( n2 != null && n2.getContent() instanceof XMLTextNode ))) {          base.abortMarkTransaction();          return false;        }        base.commitMarkTransaction();        moveCount++;        editTrees(base,dest,null,after,true,mergeLog,branchLog);        break;      case 'c': // Copy subtree        // NOTE: Will currently never copy as child of a node,        // if the node does not already have children (always inserts in childlist)        //System.err.println("CPY");        // Lock src of copy        base.beginMarkTransaction();        base.lock(MarkableBaseNode.MARK_STRUCTURE);        // Insert at dest (=insert code block)        dest = getRandomNode( baseRoot, MarkableBaseNode.MARK_STRUCTURE, base ); // NOTE! Dest must be fetched AFTER src is locked!        // Check if No possible dest or        // circular copies (i.e. dest node (or parents of it) exists in copied tree)        if( dest == null || !_treeHasNoCopyOf(base,dest,true) ) {          base.abortMarkTransaction();          return false;        }        after = rnd.nextDouble() > 0.5;        dest.lock(!after,after,MarkableBaseNode.MARK_STRUCTURE);        n = dest.getLeft().getFullMatch();        n2 = after ? n.getRightSibling() : n.getLeftSibling();        if( base.getContent() instanceof XMLTextNode &&            ( (n.getContent() instanceof XMLTextNode) ||            ( n2 != null && n2.getContent() instanceof XMLTextNode ))) {//          System.err.println("-- Abort: copying text node adjacent to other text node not possible");          base.abortMarkTransaction();          return false;        }        copyCount++;        base.commitMarkTransaction();        editTrees(null,dest,base,after,true,mergeLog,branchLog);        break;    }    return true;  }