private String createQueryString(final String prefix, final String element,
      final Map<String, String> attributes) {
    StringBuilder queryStringBuilder = new StringBuilder();
    Iterator<Entry<String, String>> attributeIter = attributes.entrySet().iterator();
    queryStringBuilder.append("//").append(prefix).append(':').append(element);

    if (!attributes.isEmpty()) {
      queryStringBuilder.append('[');
      Entry<String, String> attrEntry = attributeIter.next();
      queryStringBuilder.append('@').append(attrEntry.getKey()).append("='")
          .append(attrEntry.getValue()).append('\'');
      while (attributeIter.hasNext()) {
        attrEntry = attributeIter.next();
        queryStringBuilder.append(" and @").append(attrEntry.getKey()).append("='")
            .append(attrEntry.getValue()).append('\'');
      }

      queryStringBuilder.append(']');
    }

    return queryStringBuilder.toString();
  }
Create an XmlPath query string from the given element name and attributes.

@param element Name of the XML element to search for.
@param attributes Attributes of the element that should match, for example "name" or "id" and
       the value they should equal. This list may be empty.

@return An XmlPath query string.
geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/XmlEntity.java