code: public static String createXpathElement(String path, int index) {
  
          StringBuffer result = new StringBuffer(path.length() + 5);
          result.append(path);
          result.append('[');
          result.append(index);
          result.append(']');
          return result.toString();
      }
docs: Appends the provided index parameter in square brackets to the given name,
  like <code>path[index]</code>.<p>
  
  This method is used if it's clear that some path does not have
  a square bracket already appended.<p>
  
  @param path the path append the index to
  @param index the index to append
  
  @return the simplified Xpath for the given name