code: public static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final int index) {
          return new XMLStreamException("Unexpected attribute '" + reader.getAttributeName(index) + "' encountered",
                  reader.getLocation());
      }
docs: Get an exception reporting an unexpected XML attribute.
  @param reader the stream reader
  @param index the attribute index
  @return the exception