code: public static String transform(InputStream xmlStream, boolean verbose)
      throws SAXException, IOException
      {
          if (logger.isLoggable(Level.FINER))
          {
              logger.exiting(className, "transform(InputStream, boolean)");
          }
  
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          String result              = null;
  
          try
          {
              transform(xmlStream,baos,verbose);
              result = baos.toString("UTF-8");
              baos.close();
          }
          catch (UnsupportedEncodingException uec)
          {
              IOException iox = new IOException(uec.toString());
              iox.initCause(uec);
              throw iox;
          }
  
          if (logger.isLoggable(Level.FINER))
          {
              logger.exiting(className, "transform(InputStream, boolean)");
          }
  
          return result;
      }
docs: Method to take an input stream to an XML document and return a String of the JSON format.  Note that the xmlStream is not closed when read is complete.  This is left up to the caller, who may wish to do more with it.
  @param xmlStream The InputStream to an XML document to transform to JSON.
  @param verbose Boolean flag denoting whther or not to write the JSON in verbose (formatted), or compact form (no whitespace)
  @return A string of the JSON representation of the XML file
  
  @throws SAXException Thrown if an error occurs during parse.
  @throws IOException Thrown if an IOError occurs.