public void writeExternal(Element element) throws WriteExternalException {
   saveExpandedPaths();
   for (String subId : myReadTreeState.keySet()) {
     TreeState treeState = myReadTreeState.get(subId);
     Element subPane = new Element(ELEMENT_SUBPANE);
     if (subId != null) {
       subPane.setAttribute(ATTRIBUTE_SUBID, subId);
     }
     treeState.writeExternal(subPane);
     element.addContent(subPane);
   }
 }