PsiElement (final XmlAttribute attribute) { PsiElement nextSibling = attribute.getNextSibling(); while (nextSibling != null) { if (nextSibling instanceof XmlAttribute) return nextSibling; nextSibling = nextSibling.getNextSibling(); } return null; }