XmlAttributeValuePattern () { return XmlPatterns.xmlAttributeValue().withLocalName("href") .withSuperParent(2, XmlPatterns.xmlTag().withLocalName("include").withNamespace(XmlUtil.XINCLUDE_URI)) .with(new PatternCondition<>("XInclude inside plugin.xml") { @Override public boolean accepts(@NotNull XmlAttributeValue value, ProcessingContext context) { return PsiUtil.isPluginXmlPsiElement(value); } }); }