code: @SuppressWarnings("resource")
      private static WstxInputSource sourceFromSS(WstxInputSource parent, ReaderConfig cfg,
      		String refName, int xmlVersion, StreamSource ssrc)
          throws IOException, XMLStreamException
      {
          InputBootstrapper bs;
          Reader r = ssrc.getReader();
          String pubId = ssrc.getPublicId();
          String sysId0 = ssrc.getSystemId();
          URL ctxt = (parent == null) ? null : parent.getSource();
          URL url = (sysId0 == null || sysId0.length() == 0) ? null
              : URLUtil.urlFromSystemId(sysId0, ctxt);
  
          final SystemId systemId = SystemId.construct(sysId0, (url == null) ? ctxt : url);
          
          if (r == null) {
              InputStream in = ssrc.getInputStream();
              if (in == null) { // Need to try just resolving the system id then
                  if (url == null) {
                      throw new IllegalArgumentException("Can not create Stax reader for a StreamSource -- neither reader, input stream nor system id was set.");
                  }
                  in = URLUtil.inputStreamFromURL(url);
              }
              bs = StreamBootstrapper.getInstance(pubId, systemId, in);
          } else {
              bs = ReaderBootstrapper.getInstance(pubId, systemId, r, null);
          }
          
          Reader r2 = bs.bootstrapInput(cfg, false, xmlVersion);
          return InputSourceFactory.constructEntitySource
              (cfg, parent, refName, bs, pubId, systemId, xmlVersion, r2);
      }
docs: /*
  //////////////////////////
  Internal methods
  //////////////////////////