I am running some statistics against various URLS. I want to find the top level element with the most concentrated number of children. The method that I wo
the traverse method yields the current node and all children to a block, recursively.
# if you would like it to be returned as an array, rather than each node being yielded to a block, you can do this
result = []
doc.traverse {|node| result << node }
result
# or,
require 'enumerator'
result = doc.enum_for(:traverse).map