XmlAttributeDecl[] () { final List<XmlAttributeDecl> result = new ArrayList<>(); processElements(new FilterElementProcessor(new ClassFilter(XmlAttributeDecl.class), result) { @Override public boolean execute(final @NotNull PsiElement element) { if (element instanceof XmlAttributeDecl) { if (element.getNextSibling() == null && element.getChildren().length == 1) { return true; } return super.execute(element); } return true; } }, this); return result.toArray(new XmlAttributeDecl[0]); }