code: public static Class requiredClassAttribute(
              final XMLStreamReader reader,
              final String namespace,
              final String localName) throws XMLStreamException {
          final String value = reader.getAttributeValue(namespace, localName);
          if (value != null) {
              try {
                  return Class.forName(value.toString());
              } catch (final ClassNotFoundException e) {
                  throw createXMLStreamException(
                          MessageFormat.format("\"{0}\" is not a valid class name.", value),
                          reader,
                          e);
              }
          }
          throw new XMLStreamException(
                  MessageFormat.format("Attribute {0}:{1} is required", namespace, localName));
      }
docs: Returns the value of an attribute as a Class. If the attribute is empty, this method throws
  an exception.
  
  @param reader
  <code>XMLStreamReader</code> that contains attribute values.
  @param namespace
  namespace
  @param localName
  the local name of the attribute.
  @return value of attribute as Class
  @throws XMLStreamException
  if attribute is empty.