XmlAttributePattern (final StringPattern pattern) { return with(new PatternConditionPlus<XmlAttribute, String>("withValue", pattern) { @Override public boolean processValues(XmlAttribute t, ProcessingContext context, PairProcessor<? super String, ? super ProcessingContext> processor) { return processor.process(t.getValue(), context); } }); }