def add node, allows_children=true, &block
      raise IllegalStateException, "Cannot add a child to this node" unless @allows_children
      $log.debug " XXX def add of TreeNode #{node} parent #{self}  "
      case node
      when Array
        node.each do |e| 
          add e, allows_children, &block 
        end
      when Hash
        node.each_pair { |name, val|  
          n = _add name, allows_children, &block 
          n.add val, allows_children, &block
        }
      else
        return _add node, allows_children, &block 
      end
      self
    end
def add node, allows_children=true, &block
      raise IllegalStateException, "Cannot add a child to this node" unless @allows_children
      $log.debug " XXX def add of TreeNode #{node} parent #{self}  "
      case node
      when Array
        node.each do |e| 
          add e, allows_children, &block 
        end
      when Hash
        node.each_pair { |name, val|  
          n = _add name, allows_children, &block 
          n.add val, allows_children, &block
        }
      else
        return _add node, allows_children, &block 
      end
      self
    end
add a node to this node, optionally passing a block for further adding
 add a node as child to existing node
 If node is not a TreeNode it will be converted to one.
 @param [TreeNode, Array, Hash] node/s to add
 @param [boolean] should children be allowed
 @return [TreeNode] node last added (*NOT* self)