PsiElement (PsiElement generated, PsiElement dependsOnElement) { PsiElement e = generated; while (e != null) { e.putUserData(XmlElement.DEPENDING_ELEMENT, dependsOnElement); e = e.getNextSibling(); } return generated; }