# File lib/xtemplate/xpath.rb, line 486
      def time(val, fmt, tag=nil)
        if( tag )
          case val
          when Array
            val.collect{|v| time(v, fmt, tag)}
          when Hash
            str = Time.now.strftime(fmt)
            newval = val.dup
            tag ||= TextNode
            newval[tag] = str
            newval
          else
            if( val )
              str = Time.now.strftime(fmt)
              newval = {
                tag => str,
                TextNode => val,
              }
              newval
            else
              nil
            end
          end
        else
          Time.now.strftime(fmt)
        end
      end