# Hpricot - How to walk the tree

**URL:** <https://www.ruby-forum.com/t/hpricot-how-to-walk-the-tree/128764>\
**Category:** Ruby\
**Created:** [February 11, 2008, 11:58am UTC](https://www.ruby-forum.com/t/hpricot-how-to-walk-the-tree/128764 "2008-02-11T11:58:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/eb9ed0/32.png) [@paulf](https://www.ruby-forum.com/u/paulf)\
**Post date:** [February 11, 2008, 11:58am UTC](https://www.ruby-forum.com/t/hpricot-how-to-walk-the-tree/128764/1 "2008-02-11T11:58:56Z")

</div>

What methods can be used to walk a Hpricot::XML tree from the root all  
the way down?  
I can achieve the result I am after using Rexml stream/listener  
technique, but I would love to have Hpricot speed.  
How are containers, nodes and elements used in the process?  
I have experimented using container#containers but the process seems  
messy.

Thanks  
Paul F.
