XPathExpression (XsltElement xsltElement, String attributeName) { final XmlAttribute attribute = xsltElement.getTag().getAttribute(attributeName, null); if (attribute != null) { final PsiFile[] files = XsltSupport.getFiles(attribute); if (files.length > 0) { assert files.length == 1 : "Unexpected number of XPathFiles in @" + attributeName + ": " + Arrays.toString(files); return PsiTreeUtil.getChildOfType(files[0], XPathExpression.class); } } return null; }