List<StructureViewTreeElement> (final XmlElement element) { final List<StructureViewTreeElement> elements = new ArrayList<>(); XmlUtil.processXmlElements(element, new PsiElementProcessor() { @Override public boolean execute(final @NotNull PsiElement element) { if (element instanceof XmlElementDecl || element instanceof XmlEntityDecl) { elements.add(new DtdTreeElement((PsiNamedElement)element)); } return true; } }, false); return elements; }