code: private void removeNode(ItemState item, int indexItem)
     {
  
        items.remove(indexItem);
        index.remove(item.getData().getIdentifier());
        index.remove(item.getData().getQPath());
        index.remove(new ParentIDQPathBasedKey(item));
        index.remove(new IDStateBasedKey(item.getData().getIdentifier(), item.getState()));
        childNodesInfo.remove(item.getData().getIdentifier());
        lastChildNodeStates.remove(item.getData().getIdentifier());
        childNodeStates.remove(item.getData().getIdentifier());
        if (allPathsChanged != null && item.isPathChanged())
        {
           allPathsChanged.remove(item);
           if (allPathsChanged.isEmpty())
              allPathsChanged = null;
        }
  
        if (item.isPersisted())
        {
  
           int childInfo[] = childNodesInfo.get(item.getData().getParentIdentifier());
  
           if (childInfo != null)
           {
              if (item.isDeleted())
              {
                 ++childInfo[CHILD_NODES_COUNT];
              }
              else if (item.isAdded())
              {
                 --childInfo[CHILD_NODES_COUNT];
              }
  
              childNodesInfo.put(item.getData().getParentIdentifier(), childInfo);
           }
        }
  
        Map<String, ItemState> children = lastChildNodeStates.get(item.getData().getParentIdentifier());
        if (children != null)
        {
           children.remove(item.getData().getIdentifier());
           if (children.isEmpty())
           {
              lastChildNodeStates.remove(item.getData().getParentIdentifier());
           }
        }
  
        List<ItemState> listItemStates = childNodeStates.get(item.getData().getParentIdentifier());
        if (listItemStates != null)
        {
           listItemStates.remove(item);
           if (listItemStates.isEmpty())
           {
              childNodeStates.remove(item.getData().getParentIdentifier());
           }
        }
        if ((children == null || children.isEmpty()) && (listItemStates == null || listItemStates.isEmpty()))
        {
           childNodesInfo.remove(item.getData().getParentIdentifier());
        }
     }
docs: Removes the node from the log
  
  @param item
  ItemState