code: public void deleteResource(final String resourceName, final long nodeId) throws JaxRxException {
          synchronized (resourceName) {
              ISession session = null;
              INodeWriteTrx wtx = null;
              boolean abort = false;
              if (mDatabase.existsResource(resourceName)) {
                  try {
                      // Creating a new session
                      session =
                          mDatabase.getSession(new SessionConfiguration(resourceName, StandardSettings.KEY));
                      // Creating a write transaction
                      wtx = new NodeWriteTrx(session, session.beginBucketWtx(), HashKind.Rolling);
                      // move to node with given rest id and deletes it
                      if (wtx.moveTo(nodeId)) {
                          wtx.remove();
                          wtx.commit();
                      } else {
                          // workerHelper.closeWTX(abort, wtx, session, database);
                          throw new JaxRxException(404, NOTFOUND);
                      }
                  } catch (final TTException exce) {
                      abort = true;
                      throw new JaxRxException(exce);
                  } finally {
                      try {
                          WorkerHelper.closeWTX(abort, wtx, session);
                      } catch (final TTException exce) {
                          throw new JaxRxException(exce);
                      }
                  }
              } else {
                  throw new JaxRxException(404, "DB not found");
              }
          }
      }
docs: This method is responsible to delete an XML resource addressed through a
  unique node id (except root node id).
  
  @param resourceName
  The name of the database, which the node id belongs to.
  @param nodeId
  The unique node id.
  @throws JaxRxException
  The exception occurred.