RouteXml helper = createXmlHelper();
List<RouteDefinition> list = model.createRouteDefinitions();
try {
String text = IOUtils.loadText(ifile.getContents(), ifile.getCharset());
String newText = helper.marshalToText(text, list);
ifile.setContents(new ByteArrayInputStream(newText.getBytes()), true, true, monitor);
} catch (Exception ex) {
Activator.getLogger().error("Unable to load text from stream", ex);
}
}