private String doExport(ProgressReporter reporter, boolean types) throws IOException, XMLStreamException {
try (Transaction tx = db.beginTx()) {
StringWriter writer = new StringWriter();
XmlGraphMLWriter xmlGraphMLWriter = new XmlGraphMLWriter();
Config config = Config.config();
xmlGraphMLWriter.write(new DatabaseSubGraph(db), writer, reporter, types ? config.withTypes() : config);
tx.success();
return writer.toString().trim();
}
}