Self (@NonNls @NotNull final String localName, final ElementPattern pattern) { return with(new PatternCondition<>("withChild") { @Override public boolean accepts(@NotNull final T t, final ProcessingContext context) { for (final AbstractDomChildrenDescription description : t.getGenericInfo().getChildrenDescriptions()) { if (!(description instanceof DomChildrenDescription) || localName.equals(((DomChildrenDescription)description).getXmlElementName())) { for (final DomElement element : description.getValues(t)) { if (localName.equals(element.getXmlElementName()) && pattern.accepts(element, context)) { return true; } } } } return false; } }); }