code: protected static WstxInputSource sourceFrom(WstxInputSource parent,
      		ReaderConfig cfg, String refName,
      		int xmlVersion, Object o)
          throws IllegalArgumentException, IOException, XMLStreamException
      {
          if (o instanceof Source) {
              if (o instanceof StreamSource) {
                  return sourceFromSS(parent, cfg, refName, xmlVersion, (StreamSource) o);
              }
              /* !!! 05-Feb-2006, TSa: Could check if SAXSource actually has
               *    stream/reader available... ?
               */
              throw new IllegalArgumentException("Can not use other Source objects than StreamSource: got "+o.getClass());
          }
          if (o instanceof URL) {
              return sourceFromURL(parent, cfg, refName, xmlVersion, (URL) o, null);
          }
          if (o instanceof InputStream) {
              return sourceFromIS(parent, cfg, refName, xmlVersion, (InputStream) o, null, null);
          }
          if (o instanceof Reader) {
              return sourceFromR(parent, cfg, refName, xmlVersion, (Reader) o, null, null);
          }
          if (o instanceof String) {
              return sourceFromString(parent, cfg, refName, xmlVersion, (String) o);
          }
          if (o instanceof File) {
              URL u = URLUtil.toURL((File) o);
              return sourceFromURL(parent, cfg, refName, xmlVersion, u, null);
          }
  
          throw new IllegalArgumentException("Unrecognized input argument type for sourceFrom(): "+o.getClass());
      }
docs: Factory method that accepts various types of Objects, and tries to
  create a {@link WstxInputSource} from it. Currently it's only called
  to locate external DTD subsets, when overriding default DOCTYPE
  declarations; not for entity expansion or for locating the main
  document entity.
  
  @param parent Input source context active when resolving a new
  "sub-source"; usually the main document source.
  @param refName Name of the entity to be expanded, if any; may be
  null (and currently always is)
  @param o Object that should provide the new input source; non-type safe