String fileName = parser.option("o", null);
boolean relsBetween = parser.options().containsKey("r");
BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));
ProgressReporter reporter = new ProgressReporter(null, out);
GraphDatabaseService db = getServer().getDb();
Format exportFormat = new XmlGraphMLFormat(db);
String query = Config.extractQuery(parser);
SubGraph graph = query.isEmpty() ? new DatabaseSubGraph(db) : cypherResultSubGraph(query,relsBetween);
exportFormat.dump(graph, writer, reporter, config);
writer.close();
reporter.progress("Wrote to GraphML-file " + fileName);
return Continuation.INPUT_COMPLETE;
}