code: public static String getClassName(QName qname) {
  		try {
  			StringBuilder className = new StringBuilder();
  
  			// e.g., {http://www.w3.org/2001/XMLSchema}decimal
  			StringTokenizer st1 = new StringTokenizer(qname.getNamespaceURI(),
  					"/");
  			// --> "http:" -> "www.w3.org" --> "2001" -> "XMLSchema"
  			st1.nextToken(); // protocol, e.g. "http:"
  			String domain = st1.nextToken(); // "www.w3.org"
  
  			StringTokenizer st2 = new StringTokenizer(domain, ".");
  			List<String> lDomain = new ArrayList<String>();
  			while (st2.hasMoreTokens()) {
  				lDomain.add(st2.nextToken());
  			}
  			assert (lDomain.size() >= 2);
  			className.append(lDomain.get(lDomain.size() - 1)); // "org"
  			className.append('.');
  			className.append(lDomain.get(lDomain.size() - 2)); // "w3"
  
  			while (st1.hasMoreTokens()) {
  				className.append('.');
  				className.append(st1.nextToken());
  			}
  
  			className.append('.');
  			className.append(qname.getLocalPart());
  
  			return className.toString();
  		} catch (Exception e) {
  			return null;
  		}
  	}
docs: Returns the className for a given qname e.g.,
  {http://www.w3.org/2001/XMLSchema}decimal &rarr;
  org.w3.2001.XMLSchema.decimal
  
  @param qname
  qualified name
  @return className or null if converting is not possible