code: private EntityDecl expandUnresolvedEntity(String id)
          throws XMLStreamException
      {
          XMLResolver resolver = mConfig.getUndeclaredEntityResolver();
          if (resolver != null) {
              /* Ok, we can check for recursion here; but let's only do that
               * if there is any chance that it might get resolved by
               * the special resolver (it must have been resolved this way
               * earlier, too...)
               */
              if (mInput.isOrIsExpandedFrom(id)) {
                  throwRecursionError(id);
              }
  
              WstxInputSource oldInput = mInput;
              oldInput.saveContext(this);
              // null, null -> no public or system ids
              int xmlVersion = mDocXmlVersion;
              // 05-Feb-2006, TSa: If xmlVersion not explicitly known, defaults to 1.0
              if (xmlVersion == XmlConsts.XML_V_UNKNOWN) {
                  xmlVersion = XmlConsts.XML_V_10;
              }
              WstxInputSource newInput;
              try {
                  newInput = DefaultInputResolver.resolveEntityUsing
                      (oldInput, id, null, null, resolver, mConfig, xmlVersion);
                  if (mCfgTreatCharRefsAsEntities) {
                      return new IntEntity(WstxInputLocation.getEmptyLocation(), newInput.getEntityId(),
                              newInput.getSource(), new char[]{}, WstxInputLocation.getEmptyLocation());
                  }
              } catch (IOException ioe) {
                  throw constructFromIOE(ioe);
              }
              if (newInput != null) {
                  // true -> is external
                  initInputSource(newInput, true, id);
                  return null;
              }
          }
          handleUndeclaredEntity(id);
          return null;
      }
docs: <p>
  note: only called from the local expandEntity() method