code: public static void shredInputStream(final INodeWriteTrx wtx, final InputStream value,
          final EShredderInsert child) {
          final XMLInputFactory factory = XMLInputFactory.newInstance();
          factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
          XMLEventReader parser;
          try {
              parser = factory.createXMLEventReader(value);
          } catch (final XMLStreamException xmlse) {
              throw new WebApplicationException(xmlse);
          }
  
          try {
              final XMLShredder shredder = new XMLShredder(wtx, parser, child);
              shredder.call();
          } catch (final Exception exce) {
              throw new WebApplicationException(exce);
          }
      }
docs: Shreds a given InputStream
  
  @param wtx
  current write transaction reference
  @param value
  InputStream to be shred