void (@NotNull ProgressIndicator indicator) { writeState(); DaemonCodeAnalyzer.getInstance(getProject()).restart(); try { SAXTransformerFactory transformerFactory = (SAXTransformerFactory)TransformerFactory.newDefaultInstance(); TransformerHandler handler = transformerFactory.newTransformerHandler(); handler.getTransformer().setOutputProperty(OutputKeys.INDENT, "yes"); handler.getTransformer().setOutputProperty(OutputKeys.VERSION, "1.1"); handler.getTransformer().setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); FileUtilRt.createParentDirs(myOutputFile); try (BufferedWriter writer = new BufferedWriter(new FileWriter(myOutputFile, StandardCharsets.UTF_8))) { handler.setResult(new StreamResult(writer)); final SMTestProxy.SMRootTestProxy root = myRoot; final RunConfiguration configuration = myConfiguration; if (root != null && configuration != null) { TestResultsXmlFormatter.execute(root, configuration, myConsoleProperties, handler); } } } catch (ProcessCanceledException e) { throw e; } catch (Exception e) { LOG.info("Export to history failed", e); } }