private static void readExternalPresentation(Element element, List<CachedTreePresentationData> result) {
    var deserialized = XmlSerializer.deserialize(element, SerializableCachedPresentation.class);
    if (!deserialized.isValid()) return;
    var item = deserialized.getItem();
    var presentationData = deserialized.getData();
    var attributes = deserialized.getAttributes();
    var children = new SmartList<CachedTreePresentationData>();
    var data = new CachedTreePresentationData(item, presentationData, attributes, children);
    for (Element child : element.getChildren(PRESENTATION_TAG)) {
      readExternalPresentation(child, children);
    }
    if (!children.isEmpty()) { // Just in case isLeaf is incorrect in the XML.
      presentationData.setLeaf(false);
    }
    result.add(data);
  }
private static void readExternalPresentation(Element element, List<CachedTreePresentationData> result)