
Код AS3:
var xml:XML =
<response>
<item>
<id>1</id>
<cost>150</cost>
<period>1</period>
</item>
<item>
<id>1</id>
<cost>100</cost>
<period>2</period>
</item>
<item>
<id>2</id>
<cost>70</cost>
<period>1</period>
</item>
<item>
<id>2</id>
<cost>90</cost>
<period>2</period>
</item>
</response>;
var d:Dictionary = new Dictionary();
var list:XMLList = xml.item.id.(!d[valueOf().text().toString()] &&
(d[valueOf().text().toString()] = true));
trace(list.toXMLString());
/*
<id>1</id>
<id>2</id>
*/