Document document = createDocument(reflections);
XMLWriter xmlWriter = new XMLWriter(new FileOutputStream(file), OutputFormat.createPrettyPrint());
xmlWriter.write(document);
xmlWriter.close();
} catch (IOException e) {
throw new ReflectionsException("could not save to file " + filename, e);
} catch (Throwable e) {
throw new RuntimeException("Could not save to file " + filename + ". Make sure relevant dependencies exist on classpath.", e);
}
return file;