Hi All! I've done a few projects lately in which I've been sucking in xml product data and parsing it via javascript.... BEST THING SINCE SLICED BREAD!!!

Anyways I met an XML doc last night that I have no clue how to parse....? Any guidance or pointers would be greatly appreciated.

Here's a snippet of the XML
Code:
<temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-1">
<name>Daily Maximum Temperature</name>
<value>84</value>
<value>85</value>
<value>86</value>
<value>84</value>
<value>86</value>
<value>87</value>
<value>87</value>
</temperature>
−
<temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n6-2">
<name>Daily Minimum Temperature</name>
<value>64</value>
<value>64</value>
<value>64</value>
<value>64</value>
<value>66</value>
<value>68</value>
</temperature>
This would be my 'normal' way of accessing a particular node on the tree. But how would I access the attributes in the <temperature> tag such as type units..etc?
Code:
var hiTemp = doc.getElementsByTagName('value')[0].firstChild.data;
var hiTemp2 = doc.getElementsByTagName('value')[1].firstChild.data;
Also, since there are several parents that use the value tag name, instead of doc.getElementsByTagName('value')[532].firstChild.data is there a way that I could traverse the tree by referencing the value node by the parent?

for instance... doc.getElementsByTagName('temperature')[2].('value')[3].firstChild.data

I know this is not right, but hopefully it will illustrate what I'm attempting to accomplish.

Thanks in advance!