PsiElement (ASTNode node) { if (node.getElementType() instanceof XmlStubBasedElementType) { //noinspection rawtypes return ((XmlStubBasedElementType)node.getElementType()).createPsi(node); } throw new IncorrectOperationException("I dont know how to create XML PSI for this node: "+node+" ("+node.getClass()+")"); }