+
+ /**
+ * Transforms a document to a text output. This supports XSLT transformations
+ * that result in text documents.
+ * @param aDocument Document to transform.
+ * @param aXslt XSL transformation.
+ * @return Transformed document.
+ */
+ public String textTransform(byte[] aDocument, InputResource aXslt) throws IOException, TransformerException {
+ Source source = new StreamSource(new ByteArrayInputStream(aDocument));
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ StreamResult result = new StreamResult(os);
+ transform(source, result, aXslt);
+ return new String(os.toByteArray());
+ }