# File lib/xtemplate/xpath.rb, line 544
    def value_depth(val)
      case val
      when Hash
        max = 0
        val.each{|key,val|
          if( key == ParentNode )
            next
          end
          if( (x = value_depth(val)) > max )
            max = x
          end
        }
        max + 1
      when Array
        max = 0
        val.each{|val|
          if( (x = value_depth(val)) > max )
            max = x
          end
        }
        max
      else
        0
      end
    end