code: public void modifyResource(final String resourceName, final long nodeId, final InputStream newValue)
          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);
  
                      if (wtx.moveTo(nodeId)) {
                          final long parentKey = wtx.getNode().getParentKey();
                          wtx.remove();
                          wtx.moveTo(parentKey);
                          WorkerHelper.shredInputStream(wtx, newValue, EShredderInsert.ADDASFIRSTCHILD);
  
                      } else {
                          // workerHelper.closeWTX(abort, wtx, session, database);
                          throw new JaxRxException(404, NOTFOUND);
                      }
  
                  } catch (final TTException exc) {
                      abort = true;
                      throw new JaxRxException(exc);
                  } finally {
                      try {
                          WorkerHelper.closeWTX(abort, wtx, session);
                      } catch (final TTException exce) {
                          throw new JaxRxException(exce);
                      }
                  }
              } else {
                  throw new JaxRxException(404, "Requested resource not found");
              }
          }
      }
docs: This method is responsible to modify the XML resource, which is addressed
  through a unique node id.
  
  @param resourceName
  The name of the database, where the node id belongs to.
  @param nodeId
  The node id.
  @param newValue
  The new value of the node that has to be replaced.
  @throws JaxRxException
  The exception occurred.