code: protected static String xml2jname( String xml ) {
      // Convert pname to a valid java name
      StringBuilder nn = new StringBuilder();
      char[] cs = xml.toCharArray();
      if( !Character.isJavaIdentifierStart(cs[0]) )
        nn.append('X');
      for( char c : cs ) {
        if( !Character.isJavaIdentifierPart(c) ) {
          nn.append('_');
        } else {
          nn.append(c);
        }
      }
      String jname = nn.toString();
      return jname;
    }
docs: Convert an XML name to a java name