try {
Iterator<SyncProcess> procs = db.getSyncProcesses();
Writer out = new OutputStreamWriter(os,"UTF-8");
ItemDestination dest = new WriterItemDestination(out,"UTF-8");
ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
dest.send(constructor.createDocument());
dest.send(constructor.createElement(AdminXML.NM_SYNC_PROCESSES));
while (procs.hasNext()) {
SyncProcess proc = procs.next();
proc.marshall();
DocumentSource.generate(proc.getElement(),false,dest);