code: public static boolean isValidId(String id) {
  		if(id == null) return false;
  		int len = id.length();
  		if(len == 0) return false;
  		// First character must be [A-Za-z]
  		char ch = id.charAt(0);
  		if(
  			(ch<'A' || ch>'Z')
  			&& (ch<'a' || ch>'z')
  		) {
  			return false;
  		}
  		// Remaining characters must match [A-Za-z0-9:_.-]
  		for(int i = 1; i < len; i++) {
  			if(
  				(ch < 'A' || ch > 'Z')
  				&& (ch < 'a' || ch > 'z')
  				&& (ch < '0' || ch > '9')
  				&& ch != ':'
  				&& ch != '_'
  				&& ch != '.'
  				&& ch != '-'
  			) {
  				return false;
  			}
  		}
  		return true;
  	}
docs: Makes sure an ID is valid.
  Must match [A-Za-z][A-Za-z0-9:_.-]*
  
  @see <a href="http://www.w3.org/TR/2002/REC-xhtml1-20020801/#C_8">http://www.w3.org/TR/2002/REC-xhtml1-20020801/#C_8</a>