// IV. Perform the transformation.
// Set up the ContentHandler for the output.
FileOutputStream fos = new FileOutputStream(args[2]);
Result result = new Result(fos);
Serializer serializer = SerializerFactory.getSerializer("xml");
serializer.setOutputStream(fos);
transformer.setContentHandler(serializer.asContentHandler());