code: public final boolean shred(final InputStream xmlInput, final String resource) throws TTException {
          boolean allOk;
          INodeWriteTrx wtx = null;
          IBucketWriteTrx pWtx = null;
          ISession session = null;
          boolean abort = false;
          try {
              if (!mDatabase.existsResource(resource)) {
                  Properties properties =
                      StandardSettings.getProps(mDatabase.getLocation().getAbsolutePath(), resource);
  
                  mDatabase.createResource(new ResourceConfiguration(properties, mStorageFac, mRevision,
                      NODEFACTORY, METAFAC));
              }
  
              session = mDatabase.getSession(new SessionConfiguration(resource, StandardSettings.KEY));
              pWtx = session.beginBucketWtx();
              wtx = new NodeWriteTrx(session, pWtx, HashKind.Rolling);
              wtx.moveTo(ROOT_NODE);
              final XMLShredder shredder =
                  new XMLShredder(wtx, RESTXMLShredder.createReader(xmlInput), EShredderInsert.ADDASFIRSTCHILD);
              shredder.call();
              allOk = true;
          } catch (final Exception exce) {
              abort = true;
              throw new JaxRxException(exce);
          } finally {
              WorkerHelper.closeWTX(abort, wtx, session);
          }
          return allOk;
      }
docs: This method is responsible to save the XML file, which is in an {@link InputStream}, as a TreeTank
  object.
  
  @param xmlInput
  The XML file in an {@link InputStream}.
  @param resource
  The name of the resource.
  @return <code>true</code> when the shredding process has been successful. <code>false</code> otherwise.
  @throws TTException