Reading XML

Hey guys, I am a noob loading xml data and I need to retrieve the following information:

Here’s the important/related part of the AS3:

var data:XML = new XML( as String);
            var status:String = data.*::status.toString();

            if ( status == "success" )
                var ad:XMLList = data.*::ads.*::ad;
                var link:String = ad.*::link.toString();
                trace("DATA: " + data);
                trace("LINK: " + link);
 trace("AD TYPE: " + ???????) //<--- this is the line I need to correct. you will see below that it should trace "IMG"

Here’s the trace from DATA, so you can see the whole loaded data and suggest how I can go about and trace the TYPE under ADS / AD:

<response xsi:schemaLocation="" xmlns="" xmlns:xsi="">
    <ad id="0" type="IMG" width="300" height="50">
      <valid start="0" end="0" max="1"/>
      <action target=";jsessionid=5831058F8B711564A3BD69C9B1C0F3B3.ip-10-0-32-201" acc="server"/>

please don’t tell me that I already know it’s an IMG so I don’t need to trace it…the TYPE will change…
Thanks a lot in advance!