code: public static String[] requireAttributes(final XMLExtendedStreamReader reader, final String... attributeNames)
              throws XMLStreamException {
          final int length = attributeNames.length;
          final String[] result = new String[length];
          for (int i = 0; i < length; i++) {
              final String name = attributeNames[i];
              final String value = reader.getAttributeValue(null, name);
              if (value == null) {
                  throw missingRequired(reader, Collections.singleton(name));
              }
              result[i] = value;
          }
          return result;
      }
docs: Require all the named attributes, returning their values in order.
  @param reader the reader
  @param attributeNames the attribute names
  @return the attribute values in order
  @throws javax.xml.stream.XMLStreamException if an error occurs