PsiElement (IElementType type, ASTNode node) { if (type == XPathElementTypes.NUMBER) { return new XPathNumberImpl(node); } else if (type == XPathElementTypes.STRING) { return new XPathStringImpl(node); } else if (type == XPathElementTypes.BINARY_EXPRESSION) { return new XPathBinaryExpressionImpl(node); } else if (type == XPathElementTypes.PREFIX_EXPRESSION) { return new XPathPrefixExpressionImpl(node); } else if (type == XPathElementTypes.PARENTHESIZED_EXPR) { return new XPathParenthesizedExpressionImpl(node); } else if (type == XPathElementTypes.FILTER_EXPRESSION) { return new XPathFilterExpressionImpl(node); } else if (type == XPathElementTypes.FUNCTION_CALL) { return new XPathFunctionCallImpl(node); } else if (type == XPathElementTypes.AXIS_SPECIFIER) { return new XPathAxisSpecifierImpl(node); } else if (type == XPathElementTypes.PREDICATE) { return new XPathPredicateImpl(node); } else if (type == XPathElementTypes.LOCATION_PATH) { return new XPathLocationPathImpl(node); } else if (type == XPathElementTypes.STEP) { return new XPathStepImpl(node); } else if (type == XPathElementTypes.NODE_TEST) { return new XPathNodeTestImpl(node); } else if (type == XPathElementTypes.NODE_TYPE) { return new XPathNodeTypeTestImpl(node); } else if (type == XPathElementTypes.VARIABLE_REFERENCE) { return new XPathVariableReferenceImpl(node); } else if (type == XPathElementTypes.EMBEDDED_CONTENT) { return new XPathEmbeddedContentImpl(node); } return null; }