i need to parse the following code
<ul class="zg_hrsr">
<li class="zg_hrsr_item">
<span class="zg_hrsr_rank">#15</span>
<span class="zg_hrsr_ladder">
in
<a href="http://www.amazon.com/gp/bestsellers/digital-text/ref=pd_zg_hrsr_kstore_1_1">Kindle Store</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/154606011/ref=pd_zg_hrsr_kstore_1_2">Kindle eBooks</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/157325011/ref=pd_zg_hrsr_kstore_1_3">Nonfiction</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/292975011/ref=pd_zg_hrsr_kstore_1_4">Lifestyle & Home</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/156699011/ref=pd_zg_hrsr_kstore_1_5">Home & Garden</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/156828011/ref=pd_zg_hrsr_kstore_1_6">Gardening & Horticulture</a>
>
<b>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/156847011/ref=pd_zg_hrsr_kstore_1_7_last">Greenhouses</a>
</b>
</span>
</li>
<li class="zg_hrsr_item">
<span class="zg_hrsr_rank">#26</span>
<span class="zg_hrsr_ladder">
in
<a href="http://www.amazon.com/gp/bestsellers/digital-text/ref=pd_zg_hrsr_kstore_2_1">Kindle Store</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/154606011/ref=pd_zg_hrsr_kstore_2_2">Kindle eBooks</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/157325011/ref=pd_zg_hrsr_kstore_2_3">Nonfiction</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/292975011/ref=pd_zg_hrsr_kstore_2_4">Lifestyle & Home</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/156699011/ref=pd_zg_hrsr_kstore_2_5">Home & Garden</a>
>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/156828011/ref=pd_zg_hrsr_kstore_2_6">Gardening & Horticulture</a>
>
<b>
<a href="http://www.amazon.com/gp/bestsellers/digital-text/156849011/ref=pd_zg_hrsr_kstore_2_7_last">House Plants</a>
</b>
</span>
</li>
</ul>
and the output i desire is ,
Sellers Rank: #266,715 Paid in Kindle Store (See Top 100 Paid in Kindle Store) #15 in Kindle Store > Kindle eBooks > Nonfiction > Lifestyle & Home > Home & Garden > Gardening & Horticulture > Greenhouses #26 in Kindle Store > Kindle eBooks > Nonfiction > Lifestyle & Home > Home & Garden > Gardening & Horticulture > House Plants
how can i achieve this? All I know is that, i should get 'nodeValue' for each 'a' tag, but i am confused in getting them all in my required format, I guess i should use array, but i am un-able to implement it becuase of my low level of experty..
Guideline and Help Please. I need only structure of xPath and array(if this could be done using array) or alternative to array..