code: public static boolean isValidXmlName(String tagName, boolean colonEnabled)
      {
          boolean valid = false;
          int len = tagName != null ? tagName.length() : 0;
          for (int i = 0; i < len; i++) {
              char ch = tagName.charAt(i);
              if (i == 0) {
                  valid = isValidXmlNameStartChar(ch, colonEnabled);
              } else {
                  valid = isValidXmlNameChar(ch, colonEnabled);
              }
              if (!valid) {
                  break;
              }
          }
          return valid;
      }
docs: This method checks the given string and returns <code>true</code> if it is a valid XML name
  <p>
  See http://www.w3.org/TR/xml/#NT-Name.
  </p>
  
  @param tagName the name to check
  @param colonEnabled if this flag is <code>true</code> then this method accepts the ':' symbol in the name
  @return <code>true</code> if the given string is a valid XML name