code: @SuppressWarnings({ "unchecked" })
      public static <T> T[] readArrayAttributeElement(final XMLExtendedStreamReader reader, final String attributeName,
              final Class<T> type) throws XMLStreamException {
          final List<T> list = readListAttributeElement(reader, attributeName, type);
          return list.toArray((T[]) Array.newInstance(type, list.size()));
      }
docs: Read an element which contains only a single list attribute of a given
  type, returning it as an array.
  @param reader the reader
  @param attributeName the attribute name, usually "value"
  @param type the value type class
  @param <T> the value type
  @return the value list as an array
  @throws javax.xml.stream.XMLStreamException if an error occurs or if the
  element does not contain the specified attribute, contains other
  attributes, or contains child elements.