Buggy code:
public class XsltUpdateRequestHandlerTest extends SolrTestCaseJ4 { protected static XsltUpdateRequestHandler handler ; @ BeforeClass public static void beforeTests ( ) throws Exception { } @ Override @ Before public void setUp ( ) throws Exception { } @ Test public void testUpdate ( ) throws Exception { <START_BUG> String xml = "<random>" + ( ( ( ( ( ( ( "<seq2seq4repair_space><document>" + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"id\"<seq2seq4repair_space>enhance=\"2.2\"<seq2seq4repair_space>value=\"12345\"//>" ) + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"name\"<seq2seq4repair_space>value=\"kitten\"//>" ) + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"text\"<seq2seq4repair_space>enhance=\"3\"<seq2seq4repair_space>value=\"some<seq2seq4repair_space>other<seq2seq4repair_space>day\"//>" ) + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"title\"<seq2seq4repair_space>enhance=\"4\"<seq2seq4repair_space>value=\"A<seq2seq4repair_space>story\"//>" ) + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"timestamp\"<seq2seq4repair_space>enhance=\"5\"<seq2seq4repair_space>value=\"2011-07-01T10:31:57.140Z\"//>" ) + "<seq2seq4repair_space><//document>" ) + "<//random>" ) ; <END_BUG> Map < String , String > args = new HashMap < String , String > ( ) ; args . put ( "tr" , "xsl-update-handler-test.xsl" ) ; SolrCore core = h . getCore ( ) ; LocalSolrQueryRequest req = new LocalSolrQueryRequest ( core , new MapSolrParams ( args ) ) ; ArrayList < ContentStream > streams = new ArrayList < ContentStream > ( ) ; streams . add ( new ContentStreamBase . StringStream ( xml ) ) ; req . setContentStreams ( streams ) ; SolrQueryResponse rsp = new SolrQueryResponse ( ) ; XsltUpdateRequestHandler handler = new XsltUpdateRequestHandler ( ) ; handler . init ( new org . apache . solr . common . util . NamedList < String > ( ) ) ; handler . handleRequestBody ( req , rsp ) ; StringWriter sw = new StringWriter ( 32000 ) ; QueryResponseWriter responseWriter = core . getQueryResponseWriter ( req ) ; responseWriter . write ( sw , req , rsp ) ; req . close ( ) ; String response = sw . toString ( ) ; assertU ( response ) ; assertU ( commit ( ) ) ; assertQ ( "test<seq2seq4repair_space>document<seq2seq4repair_space>was<seq2seq4repair_space>correctly<seq2seq4repair_space>committed" , req ( "q" , "*:*" ) , "////result[@numFound='1']" , "////int[@name='id'][.='12345']" ) ; } }

Fix:
String xml = "<random>" + ( ( ( ( ( ( ( "<seq2seq4repair_space><document>" + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"id\"<seq2seq4repair_space>value=\"12345\"//>" ) + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"name\"<seq2seq4repair_space>value=\"kitten\"//>" ) + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"text\"<seq2seq4repair_space>enhance=\"3\"<seq2seq4repair_space>value=\"some<seq2seq4repair_space>other<seq2seq4repair_space>day\"//>" ) + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"title\"<seq2seq4repair_space>enhance=\"4\"<seq2seq4repair_space>value=\"A<seq2seq4repair_space>story\"//>" ) + "<seq2seq4repair_space><node<seq2seq4repair_space>name=\"timestamp\"<seq2seq4repair_space>enhance=\"5\"<seq2seq4repair_space>value=\"2011-07-01T10:31:57.140Z\"//>" ) + "<seq2seq4repair_space><//document>" ) + "<//random>" ) ;