Вот имеется XML файл:

Код:
<?xml version="1.0" encoding="utf-8" ?>
<tg1>
<item id = "1">
<id2>1</id>
<text1>qwe</text1>
<text2>qwe</text2>
</item>
<item id = "2">
<id2>2</id>
<text1>qwe</text1>
<text2>qwe</text2>
</item>
<item id = "3">
<id2>3</id>
<text1>qwe</text1>
<text2>qwe</text2>
</item>
</tg1>
<tg2>
<sp>qwerty12345</sp>
</tg2>
Вот я только знаю, что можно выбирать из XML так:

Код:
XML_VAR.firstChild.firstChild.firstChild.nodeValue
Но как можно обращаться к полям по именам, ну вобщем использовать XML, который я написал?