private void writeComposite(
     final Element res,
     final VirtualFile file,
     final EditorWithProviderComposite composite,
     final boolean pinned,
     final EditorWithProviderComposite selectedEditor) {
   final Element fileElement = new Element("file");
   fileElement.setAttribute("leaf-file-name", file.getName()); // TODO: all files
   final HistoryEntry entry = composite.currentStateAsHistoryEntry();
   entry.writeExternal(fileElement, getManager().getProject());
   fileElement.setAttribute("pinned", Boolean.toString(pinned));
   fileElement.setAttribute(
       "current", Boolean.toString(composite.equals(getManager().getLastSelected())));
   fileElement.setAttribute("current-in-tab", Boolean.toString(composite.equals(selectedEditor)));
   res.addContent(fileElement);
 }