title: Delphi XML traversing
body: <p>I am new to Delphi.  </p>
  
  <p>I wanted to find all the authors under each subject.</p>
  
  <p>Here is my XML</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;catalog&gt;
     &lt;subject id="computer"&gt;
         &lt;book id="bk101"&gt;                                                            
            &lt;author&gt;Gambardella, Matthew&lt;/author&gt;                                  
            &lt;title&gt;XML Developer's Guide&lt;/title&gt;                                   
            &lt;genre&gt;Computer&lt;/genre&gt;                                                
            &lt;price&gt;44.95&lt;/price&gt;                                                   
            &lt;publish_date&gt;2000-10-01&lt;/publish_date&gt;                                
            &lt;description&gt;An in-depth look at creating applications                 
            with XML.&lt;/description&gt;                                                
         &lt;/book&gt;                                                                   
         &lt;book id="bk112"&gt;                                                         
            &lt;author&gt;Galos, Mike&lt;/author&gt;                                           
            &lt;title&gt;Visual Studio 7: A Comprehensive Guide&lt;/title&gt;                  
            &lt;genre&gt;Computer&lt;/genre&gt;                                                
            &lt;price&gt;49.95&lt;/price&gt;                                                   
            &lt;publish_date&gt;2001-04-16&lt;/publish_date&gt;                                
            &lt;description&gt;Microsoft Visual Studio 7 is explored in depth,           
            looking at how Visual Basic, Visual C++, C#, and ASP+ are              
            integrated into a comprehensive development                            
            environment.&lt;/description&gt;                                             
         &lt;/book&gt;                                                                   
     &lt;/subject&gt;
     &lt;subject id="literature"&gt;
         &lt;book id="bk102"&gt;                                                         
            &lt;author&gt;Ralls, Kim&lt;/author&gt;                                            
            &lt;title&gt;Midnight Rain&lt;/title&gt;                                           
            &lt;genre&gt;Fantasy&lt;/genre&gt;                                                 
            &lt;price&gt;5.95&lt;/price&gt;                                                    
            &lt;publish_date&gt;2000-12-16&lt;/publish_date&gt;                                
            &lt;description&gt;A former architect battles corporate zombies,             
            an evil sorceress, and her own childhood to become queen               
            of the world.&lt;/description&gt;                                            
         &lt;/book&gt;                                                                   
         &lt;book id="bk103"&gt;                                                         
            &lt;author&gt;Corets, Eva&lt;/author&gt;                                           
            &lt;title&gt;Maeve Ascendant&lt;/title&gt;                                         
            &lt;genre&gt;Fantasy&lt;/genre&gt;                                                 
            &lt;price&gt;5.95&lt;/price&gt;                                                    
            &lt;publish_date&gt;2000-11-17&lt;/publish_date&gt;                                
            &lt;description&gt;After the collapse of a nanotechnology                    
            society in England, the young survivors lay the                        
            foundation for a new society.&lt;/description&gt;                            
         &lt;/book&gt;                                                                   
         &lt;book id="bk104"&gt;                                                         
            &lt;author&gt;Corets, Eva&lt;/author&gt;                                           
            &lt;title&gt;Oberon's Legacy&lt;/title&gt;                                         
            &lt;genre&gt;Fantasy&lt;/genre&gt;                                                 
            &lt;price&gt;5.95&lt;/price&gt;                                                    
            &lt;publish_date&gt;2001-03-10&lt;/publish_date&gt;                                
            &lt;description&gt;In post-apocalypse England, the mysterious                
            agent known only as Oberon helps to create a new life                  
            for the inhabitants of London. Sequel to Maeve                         
            Ascendant.&lt;/description&gt;                                               
         &lt;/book&gt;                                                                   
         &lt;book id="bk105"&gt;                                                         
            &lt;author&gt;Corets, Eva&lt;/author&gt;                                           
            &lt;title&gt;The Sundered Grail&lt;/title&gt;                                      
            &lt;genre&gt;Fantasy&lt;/genre&gt;                                                 
            &lt;price&gt;5.95&lt;/price&gt;                                                    
            &lt;publish_date&gt;2001-09-10&lt;/publish_date&gt;                                
            &lt;description&gt;The two daughters of Maeve, half-sisters,                 
            battle one another for control of England. Sequel to                   
            Oberon's Legacy.&lt;/description&gt;                                         
         &lt;/book&gt;                                                                   
         &lt;book id="bk106"&gt;                                                         
            &lt;author&gt;Randall, Cynthia&lt;/author&gt;                                      
            &lt;title&gt;Lover Birds&lt;/title&gt;                                             
            &lt;genre&gt;Romance&lt;/genre&gt;                                                 
            &lt;price&gt;4.95&lt;/price&gt;                                                    
            &lt;publish_date&gt;2000-09-02&lt;/publish_date&gt;                                
            &lt;description&gt;When Carla meets Paul at an ornithology                   
            conference, tempers fly as feathers get ruffled.&lt;/description&gt;         
         &lt;/book&gt;                                                                   
         &lt;book id="bk107"&gt;                                                         
            &lt;author&gt;Thurman, Paula&lt;/author&gt;                                        
            &lt;title&gt;Splish Splash&lt;/title&gt;                                           
            &lt;genre&gt;Romance&lt;/genre&gt;                                                 
            &lt;price&gt;4.95&lt;/price&gt;                                                    
            &lt;publish_date&gt;2000-11-02&lt;/publish_date&gt;                                
            &lt;description&gt;A deep sea diver finds true love twenty                   
            thousand leagues beneath the sea.&lt;/description&gt;                        
         &lt;/book&gt;                                                                   
         &lt;book id="bk108"&gt;                                                         
            &lt;author&gt;Knorr, Stefan&lt;/author&gt;                                         
            &lt;title&gt;Creepy Crawlies&lt;/title&gt;                                         
            &lt;genre&gt;Horror&lt;/genre&gt;                                                  
            &lt;price&gt;4.95&lt;/price&gt;                                                    
            &lt;publish_date&gt;2000-12-06&lt;/publish_date&gt;                                
            &lt;description&gt;An anthology of horror stories about roaches,             
            centipedes, scorpions  and other insects.&lt;/description&gt;                
         &lt;/book&gt;                                                                   
         &lt;book id="bk109"&gt;                                                         
            &lt;author&gt;Kress, Peter&lt;/author&gt;                                          
            &lt;title&gt;Paradox Lost&lt;/title&gt;                                            
            &lt;genre&gt;Science Fiction&lt;/genre&gt;                                         
            &lt;price&gt;6.95&lt;/price&gt;                                                    
            &lt;publish_date&gt;2000-11-02&lt;/publish_date&gt;                                
            &lt;description&gt;After an inadvertant trip through a Heisenberg            
            Uncertainty Device, James Salway discovers the problems                
            of being quantum.&lt;/description&gt;                                        
         &lt;/book&gt;                                                                   
         &lt;book id="bk110"&gt;                                                         
            &lt;author&gt;O'Brien, Tim&lt;/author&gt;                                          
            &lt;title&gt;Microsoft .NET: The Programming Bible&lt;/title&gt;                   
            &lt;genre&gt;Computer&lt;/genre&gt;                                                
            &lt;price&gt;36.95&lt;/price&gt;                                                   
            &lt;publish_date&gt;2000-12-09&lt;/publish_date&gt;                                
            &lt;description&gt;Microsoft's .NET initiative is explored in                
            detail in this deep programmer's reference.&lt;/description&gt;              
         &lt;/book&gt;                                                                   
         &lt;book id="bk111"&gt;                                                         
            &lt;author&gt;O'Brien, Tim&lt;/author&gt;                                          
            &lt;title&gt;MSXML3: A Comprehensive Guide&lt;/title&gt;                           
            &lt;genre&gt;Computer&lt;/genre&gt;                                                
            &lt;price&gt;36.95&lt;/price&gt;                                                   
            &lt;publish_date&gt;2000-12-01&lt;/publish_date&gt;                                
            &lt;description&gt;The Microsoft MSXML3 parser is covered in                 
            detail, with attention to XML DOM interfaces, XSLT processing,         
            SAX and more.&lt;/description&gt;                                            
         &lt;/book&gt;                                                                   
     &lt;/subject&gt;
  &lt;/catalog&gt;
  </code></pre>