BoostFunction root = FunctionFactory.identity();
BoostFunction xmlToSource = new XMLFunctions(XMLFunctions.Operation.toSource);
graph.addEdges(root, xmlToSource);
BoostFunction outputStream = new FunctionByTransformer( new TransformerWithInstanceCreation<Object, ByteArrayOutputStream>(ByteArrayOutputStream.class));
graph.addEdges(root, outputStream);
BoostFunction encoding = new FunctionByTransformer( TransformerBoostUtils.createConstantTransformer("encoding",xmlResultEncoding));
graph.addEdges(root, encoding);
BoostFunction omitProcessingInstruction = new FunctionByTransformer( TransformerBoostUtils.createConstantTransformer("omit processing instruction", ! displayXMLDeclaration));
graph.addEdges(root, omitProcessingInstruction);
BoostFunction writer = new FunctionByTransformer( new SourceToOutputStreamWriter());
graph.addEdges( xmlToSource, writer);
graph.addEdges( outputStream, writer);
graph.addEdges( encoding, writer);
graph.addEdges( omitProcessingInstruction, writer);