title: How can I get multiple attributes from XML file?
body: <p>I have an XML file:</p>
  
  <pre><code>&lt;One&gt;
    &lt;Document Count="1"&gt;
      &lt;Customer Id="1" Type="0"/&gt;
      &lt;Passengers&gt;
        &lt;Passenger Seq="1" Id="13" Name="Test Name"/&gt;
        &lt;Passenger Seq="2" Id="14" Name="Test Name4"/&gt;
      &lt;/Passengers&gt;
    &lt;/Document&gt;
    &lt;Document Count="2"&gt;
      &lt;Customer Id="2" Type="0"/&gt;
      &lt;Passengers&gt;
        &lt;Passenger Seq="1" Id="16" Name="Test Name10"/&gt;
        &lt;Passenger Seq="2" Id="18" Name="Test Name30"/&gt;
      &lt;/Passengers&gt;
    &lt;/Document&gt;
  &lt;/One&gt;
  ...
  &lt;Two&gt;
    &lt;Document Count="1"&gt;
      &lt;User Id="1" Type="0"/&gt;
      &lt;Passengers&gt;
        &lt;Passenger Seq="1" Id="123" Name="Test Name"/&gt;
        &lt;Passenger Seq="2" Id="124" Name="Test Name2"/&gt;
      &lt;/Passengers&gt;
    &lt;/Document&gt;
    &lt;Document Count="2"&gt;
      &lt;Customer Id="2" Type="0"/&gt;
      &lt;Passengers&gt;
        &lt;Passenger Seq="1" Id="1130" Name="Test Name123"/&gt;
        &lt;Passenger Seq="2" Id="1131" Name="Test Name34342"/&gt;
      &lt;/Passengers&gt;
    &lt;/Document&gt;
  &lt;/Two&gt;
  </code></pre>
  
  <p>My steps:</p>
  
  <pre><code>array = []
  doc = Nokogiri::XML(File.open(file.xml))    
  doc_pass = doc.xpath("//Document//Passengers//Passenger")    
  doc_pass.each do |pass|
    hash = {}
    hash[:id] = pass['Name'] #???
    array &lt;&lt; hash  
  end
  </code></pre>
  
  <p>I want to get all attributes like <code>Id</code>, <code>Name</code> from Passengers, and create a hash with all passengers. 
  Example:</p>
  
  <pre><code>[{ :id =&gt; '13', :name =&gt; "Test Name"}, { :id =&gt; '14', :name =&gt; "Test Name4"}, { :id =&gt; '16', :name =&gt; "Test Name10"}, { :id =&gt; '18', :name =&gt; "Test Name30"}, { :id =&gt; '123', :name =&gt; "Test Name"} ... ]
  </code></pre>
  
  <p>How can I do that?</p>