Counting XML Nodes

I’m creating a news rotator based on RSS feed XML. I would like to display the number of news items and which number is currently displaying as they rotate through the timer. (i.e. item 2 of 4)

I have been able to get the total number of items using the length() method, but I’m not sure how to reference each item. Do I need to actually append a node and assign a number or is there an easier way.

My code looks like this so far:

var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();

xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("RSS.xml"));

function LoadXML(e:Event):void {
    xmlData = new XML(;
    xmlLoader.removeEventListener(Event.COMPLETE, LoadXML);

function ParseNews(newsInput:XML):void{
    var NumItems:int = newsInput.*.item.length();
    var itemList:XMLList =;
    for each (var itemElement:XML in itemList){
        //add code to number each new item
        //add code to create an news object instance

Thanks for any help.