docs: protected static ArtifactMap populateArtifactMapFromStream(ArtifactMap tempMap, InputStream is) {
          XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
  
          try {
              XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(is);
  
              if (logger.isLoggable(Level.FINEST)) {
                  logger.finest("Loaded XMLStreamReader = " + xmlStreamReader);
              }
  
              boolean processedRoot = false;
  
              // We are going to take advantage of the simplified structure of a
              // line
              // E.g.:
              // <batch-artifacts>
              //   <item-processor id=MyItemProcessor class=jsr352/sample/MyItemProcessorImpl/>
              //   ..
              // </batch-artifacts>
              //
              // and have much simpler logic than general-purpose parsing would
              // require.
              while (xmlStreamReader.hasNext()) {
                  int event = xmlStreamReader.next();
  
                  // Until we reach end of document
                  if (event == XMLStreamConstants.END_DOCUMENT) {
                      break;
                  }
  
                  // At this point we have either:
                  //    A) just passed START_DOCUMENT, and are at START_ELEMENT for the root,
                  //       <batch-artifacts>, or
                  //    B) we have just passed END_ELEMENT for one of the artifacts which is a child of
                  //       <batch-artifacts>.
                  //
                  //  Only handle START_ELEMENT now so we can skip whitespace CHARACTERS events.
                  //
                  if (event == XMLStreamConstants.START_ELEMENT) {
                      if (!processedRoot) {
                          QName rootQName = xmlStreamReader.getName();
                          if (!rootQName.equals(BATCH_ROOT_ELEM)) {
                              throw new IllegalStateException("Expecting document with root element QName: " + BATCH_ROOT_ELEM
                                                              + ", but found root element with QName: " + rootQName);
                          } else {
                              processedRoot = true;
                          }
                      } else {
  
                          // Should only need localName
                          String annotationShortName = xmlStreamReader.getLocalName();
                          String id = xmlStreamReader.getAttributeValue(null, "id");
                          String className = xmlStreamReader.getAttributeValue(null, "class");
                          tempMap.addEntry(annotationShortName, id, className);
  
                          // Ignore anything else (text/whitespace) within this
                          // element
                          while (event != XMLStreamConstants.END_ELEMENT) {
                              event = xmlStreamReader.next();
                          }
                      }
                  }
              }
              xmlStreamReader.close();
              is.close();
              return tempMap;
  
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
      }