code: public static TagOutput getParentTagOutput(TagOutput stat) {
  	Statement parent = stat;
  
  	while (true) {
  	    parent = parent.getParent();
  	    if (parent == null) return null;
  	    if (parent instanceof TagOutput) return (TagOutput) parent;
  	}
      }
docs: /*
  private FunctionLibFunction getEncodeForFunction(FunctionLib[] flibs) throws EvaluatorException {
  FunctionLibFunction f; if(flibs!=null)for(int i=0;i<flibs.length;i++) { f =
  flibs[i].getFunction("ESAPIEncode"); if(f!=null) return f; } // should never happen throw new
  EvaluatorException("could not find function ESAPIEncode ("+(flibs==null?"null":""+flibs.length)+
  ")"); }