title: Nokogiri pull parser (Nokogiri::XML::Reader) issue with self closing tag
body: <p>I have a huge XML(>400MB) containing products. Using a DOM parser is therefore excluded, so i tried to parse and process it using a pull parser. Below is a snippet from the <code>each_product(&amp;block)</code> method where i iterate over the product list. </p>
  
  <p>Basically, using a stack, i transform each <code>&lt;product&gt; ... &lt;/product&gt;</code> node into a hash and process it. </p>
  
  <pre><code>while (reader.read)
    case reader.node_type
      #start element
      when Nokogiri::XML::Node::ELEMENT_NODE
        elem_name = reader.name.to_s
        stack.push([elem_name, {}])
  
      #text element
      when Nokogiri::XML::Node::TEXT_NODE, Nokogiri::XML::Node::CDATA_SECTION_NODE
        stack.last[1] = reader.value
  
      #end element
      when Nokogiri::XML::Node::ELEMENT_DECL
        return if stack.empty?
  
        elem = stack.pop
        parent = stack.last
        if parent.nil?
          yield(elem[1])
          elem = nil
          next
        end
  
        key = elem[0]
        parent_childs = parent[1]
      # ... 
        parent_childs[key] =  elem[1]
      end
  </code></pre>
  
  <p>The issue is on self-closing tags (EG <code>&lt;country/&gt;</code>), as i can not make the difference between a 'normal' and a 'self-closing' tag. They both are of type <code>Nokogiri::XML::Node::ELEMENT_NODE</code> and i am not able to find any other discriminator in the <a href="http://nokogiri.rubyforge.org/nokogiri/Nokogiri/XML/Reader.html" rel="nofollow noreferrer">documentation</a>.</p>
  
  <p>Any ideas on how to solve this issue?</p>