def each(cond=nil)
      if cond.nil?
        nodes.each { |n| yield(n) }
      else
        cond = cond.to_s if cond.is_a?(Symbol)
        if cond.is_a?(String)
          nodes.each { |n| yield(n) if n.is_a?(Element) && cond == n.name }
        elsif cond.is_a?(Hash)
          nodes.each { |n| yield(n) if n.is_a?(Element) && n.attr_match(cond) }
        end
      end
    end
def each(cond=nil)
      if cond.nil?
        nodes.each { |n| yield(n) }
      else
        cond = cond.to_s if cond.is_a?(Symbol)
        if cond.is_a?(String)
          nodes.each { |n| yield(n) if n.is_a?(Element) && cond == n.name }
        elsif cond.is_a?(Hash)
          nodes.each { |n| yield(n) if n.is_a?(Element) && n.attr_match(cond) }
        end
      end
    end
Iterate over each child of the instance yielding according to the cond
 argument value. If the cond argument is nil then all child nodes are
 yielded to. If cond is a string then only the child Elements with a
 matching name will be yielded to. If the cond is a Hash then the
 keys-value pairs in the cond must match the child attribute values with
 the same keys. Any other cond type will yield to nothing.