FileModifier (@NotNull PsiFile target) { PsiElement copy = PsiTreeUtil.findSameElementInCopy(myRef.getElement(), target); PsiReference reference = copy.getReference(); CreateXmlElementIntentionAction intentionAction = new CreateXmlElementIntentionAction(myMessageKey, myDeclarationTagName, (TypeOrElementOrAttributeReference)reference); intentionAction.myTargetFile = (XmlFile)target; return intentionAction; }