String (final XmlAttributeInjection injection) { final String name = injection.getAttributeName(); final String namespace = injection.getAttributeNamespace(); final StringBuilder result = new StringBuilder("xmlAttribute()"); if (StringUtil.isNotEmpty(name)) appendStringPattern(result, ".withLocalName(", name, ")"); if (StringUtil.isNotEmpty(namespace)) appendStringPattern(result, ".withNamespace(", namespace, ")"); if (StringUtil.isNotEmpty(injection.getTagName()) || StringUtil.isNotEmpty(injection.getTagNamespace())) { result.append(".").append(injection.isApplyToSubTags() ? "inside" : "withParent").append("(") .append(XmlTagInjection.getPatternString(injection)).append(")"); } return result.toString(); }