Use Regular Expressions in E4X Queries
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Script> private var xmlItems:XML =<order> <item id="1"> <menuName>A</menuName> <price>3.5</price> </item> <item id="2000"> <menuName>B</menuName> <price>1.45</price> </item> </order> private var arr:Array; private function init():void { arr = new Array(); for each ( var xml:XML in xmlItems) { arr.push(xmlItems.item.(/\d\d\d/.test(@id)).price); } trace(arr); } </mx:Script> </mx:Application>