public static boolean isValidXmlIdentifier(String s){
  if (s != null) {
    int len=s.length();
    if (len == 0) {
      return false;
    }
    for (int i=0; i < len; i++) {
      char ch=s.charAt(i);
      if ((i == 0 && !Character.isUnicodeIdentifierStart(ch)) || (!Character.isUnicodeIdentifierStart(ch) && !Character.isDigit(ch) && !Utils.isIdentifierHelperChar(ch))) {
        return false;
      }
    }
    return true;
  }
  return false;
}

public static boolean isValidXmlIdentifier ( String s ) { if ( s != null ) { int len = s . length ( ) ; if ( len == 0 ) { return false ; } for ( int i = 0 ; i < len ; i ++ ) { char ch = s . charAt ( i ) ; if ( ( i == 0 && ! Character . isUnicodeIdentifierStart ( ch ) ) || ( ! Character . isUnicodeIdentifierStart ( ch ) && ! Character . isDigit ( ch ) && ! Utils . isIdentifierHelperChar ( ch ) ) ) { return false ; } } return true ; } return false ; }
checks whether specified string can be valid tag name or attribute name in xml .
