public static boolean matchesXMLString(char[] buf,int off,int end,String str){
  int len=str.length();
  if (len != end - off)   return false;
  for (int i=0; i < len; off+=1, i++) {
    if (buf[off] != str.charAt(i))     return false;
  }
  return true;
}

public static boolean matchesXMLString ( char [ ] buf , int off , int end , String str ) { int len = str . length ( ) ; if ( len != end - off ) return false ; for ( int i = 0 ; i < len ; off += 1 , i ++ ) { if ( buf [ off ] != str . charAt ( i ) ) return false ; } return true ; }
returns true if the specified char subarray is equal to the string . the string must contain only xml significant characters .
