Element (@NotNull Element parentNode) { for (ViewImpl eachState : myViews.values()) { if (myLightWeightIds != null && myLightWeightIds.contains(eachState.getID())) { continue; } Element element = XmlSerializer.serialize(eachState); parentNode.addContent(element == null ? new Element("ViewImpl") : element); } for (TabImpl eachTab : myTabs) { if (isUsed(eachTab)) { Element element = XmlSerializer.serialize(eachTab); parentNode.addContent(element == null ? new Element("TabImpl") : element); } } Element generalContent = XmlSerializer.serialize(myGeneral); if (generalContent != null) { parentNode.addContent(generalContent); } return parentNode; }