code: public static void transformMessage(Reader reader, Writer stringWriter, Reader readerxsl)
      {
          try {
              StreamSource source = new StreamSource(reader);
  
              Result result = new StreamResult(stringWriter);
  
              TransformerFactory tFact = TransformerFactory.newInstance();
              StreamSource streamTransformer = new StreamSource(readerxsl);
              
              Transformer transformer = tFact.newTransformer(streamTransformer);
  
              transformer.transform(source, result);
          } catch (TransformerConfigurationException ex)    {
              ex.printStackTrace();
          } catch (TransformerException ex) {
              ex.printStackTrace();
          }                    
      }
docs: Use XSLT to convert this source tree into a new tree.
  @param result If this is specified, transform the message to this result (and return null).
  @param source The source to convert.
  @param streamTransformer The (optional) input stream that contains the XSLT document.
  If you don't supply a streamTransformer, you should override getTransforerStream() method.
  @return The new tree.