def check_node(node, level, ctr)
     if (@@text_elements.include? node.name)
       ctr << {:type => :para, :level => level, :words => count_content_words(node)}
     elsif (@@section_elements.include? node.name)
       title = find_section_title(node)
       ctr << {:type => :section, :level => level, :title => title, :name => node.name}
       node.children.each {|inner_elem| check_node(inner_elem, level+1, ctr)} if node.children?
     else
       node.children.each {|inner_elem| check_node(inner_elem, level+1, ctr)} if node.children?
     end

     ctr
   end
def check_node(node, level, ctr)
     if (@@text_elements.include? node.name)
       ctr << {:type => :para, :level => level, :words => count_content_words(node)}
     elsif (@@section_elements.include? node.name)
       title = find_section_title(node)
       ctr << {:type => :section, :level => level, :title => title, :name => node.name}
       node.children.each {|inner_elem| check_node(inner_elem, level+1, ctr)} if node.children?
     else
       node.children.each {|inner_elem| check_node(inner_elem, level+1, ctr)} if node.children?
     end

     ctr
   end
Check the document elements for content and type recursively,
 starting at the current node.  Returns an array with paragraph and
 section maps.