code: public boolean isOrIsExpandedFrom(String entityId)
      {
          if (entityId != null) { // should always be true
              WstxInputSource curr = this;
              while (curr != null) {
                  if (entityId == curr.mFromEntity) {
                      return true;
                  }
                  curr = curr.mParent;
              }
          }
          return false;
      }
docs: Method that checks if this input source expanded from the specified
  entity id, directly or by ancestor.
  <p>
  Note that entity ids are expected to have been interned (using
  whatever uniqueness mechanism used), and thus can be simply
  identity checked.