obteniendo error en la transformación xslt a través de java

Estoy intentando una transformación xsl que en este momento por un objeto java estoy generando un XML intermediario y ese XML se pasa nuevamente para generar un nuevo XML finalmente ahora mismo mientras que en la transformación xsl obtengo el error, déjenme mostrarles debajo de mi pieza de código que he intentado.

A continuación se muestra mi clase en la que primero estoy creando objetos y luego a través de xstream generando el XML intermediario

InvoiceReferenceNotificationMessage invoiceReferenceNotificationMessage = new InvoiceReferenceNotificationMessage();
        invoiceReferenceNotificationMessage.setInvoiceReference("SM/8315");
        invoiceReferenceNotificationMessage.setABSReference("IRMA5456R157311");
        invoiceReferenceNotificationMessage.setCurrency("GBP");
        invoiceReferenceNotificationMessage.setInvoiceAmount(255646);
        invoiceReferenceNotificationMessage.setPaidAmount(1246565);
        invoiceReferenceNotificationMessage.setBalanceAmount(0);
        invoiceReferenceNotificationMessage.setValueDate(new Date());
        invoiceReferenceNotificationMessage.setRemarks("abc");


        InvoiceReferenceNotificationMessage invoiceReferenceNotificationMessage1 = new InvoiceReferenceNotificationMessage();
        invoiceReferenceNotificationMessage1.setInvoiceReference("SM/1655");
        invoiceReferenceNotificationMessage1.setABSReference("I1575656311");
        invoiceReferenceNotificationMessage1.setCurrency("EUR");
        invoiceReferenceNotificationMessage1.setInvoiceAmount(25655546);
        invoiceReferenceNotificationMessage1.setPaidAmount(1255565645);
        invoiceReferenceNotificationMessage1.setBalanceAmount(0);
        invoiceReferenceNotificationMessage1.setValueDate(new Date());
        invoiceReferenceNotificationMessage1.setRemarks("abERRc");

  Transformer xsltTransformer = null;
        Mail m = new Mail();

        m.setInvoiceReferenceNotificationMessage(invoiceReferenceNotificationMessage);

        XStream xstream = new XStream();
        xstream.alias("brokermail",Mail.class);
        String abc = xstream.toXML(m);
        //System.out.println(abc);

        m.setInvoiceReferenceNotificationMessage(invoiceReferenceNotificationMessage1);
        xstream.alias("brokermail",Mail.class);
        String def = xstream.toXML(m);
        //System.out.println(def);

        String t =abc+def;
        System.out.println(t);

El código anterior genera el siguiente XML a continuación

 <brokermail>
  <invoiceReferenceNotificationMessage>
    <InvoiceReference>SM/82973409/0315</InvoiceReference>
    <ABSReference>IRMAR43157311</ABSReference>
    <Currency>GBP</Currency>
    <InvoiceAmount>25446.0</InvoiceAmount>
    <PaidAmount>12435.0</PaidAmount>
    <BalanceAmount>0.0</BalanceAmount>
    <ValueDate>2015-05-21 21:58:04.439 IST</ValueDate>
    <Remarks>abc</Remarks>
  </invoiceReferenceNotificationMessage>
</brokermail><brokermail>
  <invoiceReferenceNotificationMessage>
    <InvoiceReference>SM/13435</InvoiceReference>
    <ABSReference>I157343411</ABSReference>
    <Currency>EUR</Currency>
    <InvoiceAmount>2554546.0</InvoiceAmount>
    <PaidAmount>12534545.0</PaidAmount>
    <BalanceAmount>0.0</BalanceAmount>
    <ValueDate>2015-05-21 21:58:04.439 IST</ValueDate>
    <Remarks>abERRc</Remarks>
  </invoiceReferenceNotificationMessage>
</brokermail>

Ahora tengo que hacer la transformación xsl que es pasar el XML generado anteriormente y luego generar un nuevo XML que estoy haciendo a través de xalan. A continuación se muestra lo que he intentado, pero mi XML final no se genera, ya que recibo el error, por favor avise cómo superar esto, estoy usando la API de xalan

System.out.println("******%%%%%%%%%%%%%*************");
        String t =abc+def;
        System.out.println(t);
        Source msgStreamSource = null;

        ByteArrayInputStream byteStream = new ByteArrayInputStream(t.getBytes());
        BufferedInputStream buffMsg = new BufferedInputStream(byteStream);
        msgStreamSource = new StreamSource(buffMsg);

             Transformer xsltTransformer1 = null;

            StringWriter strWriter = new StringWriter();
            // Result stream
            Result xmlOutput = new StreamResult(strWriter);
            // String to hold transformed xml
            String transformedMessage = null;
            TransformerFactory transFact = TransformerFactory.newInstance();
            try
            {
            //*******#########****** error is on this below line ********###########***********
                xsltTransformer1 = transFact.newTransformer(msgStreamSource);
            //*******#########****** error is on this below line ********###########***********
                // perform XSL transformation
                xsltTransformer1.transform(msgStreamSource, xmlOutput);
                // get the transformed xml
                transformedMessage = strWriter.toString();
            }
            finally
            {
                strWriter.close();
            }

            System.out.println(transformedMessage);
        }

el error que estoy obteniendo es por favor aconsejar cómo superar esto

[Fatal Error] :12:15: The markup in the document following the root element must be well-formed.
ERROR:  'The markup in the document following the root element must be well-formed.'
FATAL ERROR:  'Could not compile stylesheet'
Exception in thread "main" javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown Source)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(Unknown Source)

Respuestas a la pregunta(1)

Su respuesta a la pregunta