PipedOutputStream pos = new PipedOutputStream();
PipedInputStream pii = new PipedInputStream(pos);
final SLDParser parser = new SLDParser(factory, pii);
IMarshallingContext mctx = bfact.createMarshallingContext();
mctx.setOutput(new PrintWriter(pos));
CountDownLatch countDown = new CountDownLatch(2);
ArrayList<Style> styles = new ArrayList<Style>();
new Thread(new Parser(countDown, parser, styles)).start();
new Thread(new Marshaller(countDown, mctx, sld)).start();