FileOutputStream fos = new FileOutputStream(output);
OFXV1Writer writer = new OFXV1Writer(fos);
writer.setWriteAttributesOnNewLine(true);
AggregateMarshaller marshaller = new AggregateMarshaller();
marshaller.setConversion(new MyFinanceStringConversion());
marshaller.marshal(envelope, writer);
writer.flush();
writer.close();
}
}