code: public void remove() throws RepositoryException, ConstraintViolationException, VersionException, LockException
     {
  
        checkValid();
  
        if (isRoot())
        {
           throw new RepositoryException("Can't remove ROOT node.");
        }
  
        // Check constraints
        ItemDefinition def;
        if (isNode())
        {
           def = ((NodeImpl)this).getDefinition();
        }
        else
        {
           def = ((PropertyImpl)this).getDefinition();
        }
  
        if (def.isMandatory() || def.isProtected())
        {
           throw new ConstraintViolationException("Can't remove mandatory or protected item " + getPath());
        }
  
        NodeImpl parentNode = parent();
        // Check if versionable ancestor is not checked-in
        if (!parentNode.checkedOut())
        {
           throw new VersionException("Node " + parent().getPath() + " or its nearest ancestor is checked-in");
        }
  
        // Check locking
        if (!parentNode.checkLocking())
        {
           throw new LockException("Node " + parent().getPath() + " is locked ");
        }
  
        // launch event
        session.getActionHandler().preRemoveItem(this);
  
        removeVersionable();
  
        // remove from datamanager
        dataManager.delete(data);
     }
docs: {@inheritDoc}