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