t.setParameter("MessageControlID", HL7Segment.nextMessageControlID());
t.setParameter("DateTimeOfMessage", HL7Segment.timeStamp(new Date()));
if (xsltParams != null)
for (int i = 1; i < xsltParams.length; i++, i++)
t.setParameter(xsltParams[i-1], xsltParams[i]);
th.setResult(new SAXResult(new HL7ContentHandler(
new OutputStreamWriter(out, charsetName))));
new HL7Parser(th).parse(new InputStreamReader(
new ByteArrayInputStream(msg, off, len),
charsetName));
return out.toByteArray();