PsiElement (@NotNull XmlTag xmlTag) { final PsiElement[] child = new PsiElement[1]; xmlTag.processElements(new PsiElementProcessor() { @Override public boolean execute(@NotNull PsiElement element) { if (element instanceof XmlToken) { if (((XmlToken)element).getTokenType() == XmlTokenType.XML_TAG_END) { child[0] = element.getNextSibling(); return false; } } return true; } }, xmlTag); return child[0]; }