public static boolean isName(CharSequence possibleName) {
        final int barrier = possibleName.length();
        int i = 0;
        boolean valid = true;
        boolean first = true;

        if (barrier < 1) {
            valid = false;
        }

        while (valid && i < barrier) {
            char c = possibleName.charAt(i++);
            if (Character.isHighSurrogate(c)) {
                valid = nameChar(Character.toCodePoint(c, possibleName.charAt(i++)), first);
            } else {
                valid = nameChar((int) c, first);
            }
            first = false;
        }
        return valid;
    }
Check whether the name of a tag or attribute conforms to <a
href="http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-common-syn">XML
1.1 (Second Edition)</a>. This does not check against reserved names, it
only checks the set of characters used.

@param possibleName a possibly valid XML name
@return true if the name may be used as an XML tag or attribute name
vespajlib/src/main/java/com/yahoo/text/XML.java