code: static XPath rewriteChildToExpression(ElemTemplateElement varElem)
            throws TransformerException
    {
  
      ElemTemplateElement t = varElem.getFirstChildElem();
  
      // Down the line this can be done with multiple string objects using 
      // the concat function.
      if (null != t && null == t.getNextSiblingElem())
      {
        int etype = t.getXSLToken();
  
        if (Constants.ELEMNAME_VALUEOF == etype)
        {
          ElemValueOf valueof = (ElemValueOf) t;
  
          // %TBD% I'm worried about extended attributes here.
          if (valueof.getDisableOutputEscaping() == false
                  && valueof.getDOMBackPointer() == null)
          {
            varElem.m_firstChild = null;
  
            return new XPath(new XRTreeFragSelectWrapper(valueof.getSelect().getExpression()));
          }
        }
        else if (Constants.ELEMNAME_TEXTLITERALRESULT == etype)
        {
          ElemTextLiteral lit = (ElemTextLiteral) t;
  
          if (lit.getDisableOutputEscaping() == false
                  && lit.getDOMBackPointer() == null)
          {
            String str = lit.getNodeValue();
            XString xstr = new XString(str);
  
            varElem.m_firstChild = null;
  
            return new XPath(new XRTreeFragSelectWrapper(xstr));
          }
        }
      }
  
      return null;
    }
docs: If the children of a variable is a single xsl:value-of or text literal,
  it is cheaper to evaluate this as an expression, so try and adapt the
  child an an expression.
  
  @param varElem Should be a ElemParam, ElemVariable, or ElemWithParam.
  
  @return An XPath if rewrite is possible, else null.
  
  @throws TransformerException