code: public static String getXpathIndex(String path) {
  
          int pos1 = path.lastIndexOf('/');
          int pos2 = path.lastIndexOf('[');
          if ((pos2 < 0) || (pos1 > pos2)) {
              return "";
          }
  
          return path.substring(pos2);
      }
docs: Returns the last Xpath index from the given path.<p>
  
  Examples:<br>
  <code>title</code> returns the empty String<p>
  <code>title[1]</code> returns <code>[1]</code><p>
  <code>title/subtitle</code> returns them empty String<p>
  <code>title[1]/subtitle[1]</code> returns <code>[1]</code><p>
  
  @param path the path to extract the Xpath index from
  
  @return  the last Xpath index from the given path