code: public static XMLStreamException duplicateAttribute(final XMLStreamReader reader, final String name) {
          return new XMLStreamException("An attribute named '" + name + "' has already been declared", reader.getLocation());
      }
docs: Get an exception reporting that an attribute of a given name has already
  been declared in this scope.
  @param reader the stream reader
  @param name the name that was redeclared
  @return the exception