E4X - Returning Attributes

I’m a little confused with the attribute aspect of E4X.

Basically I have something like this


<GALLERY>
    <GALLERY TEAM="KNICKS">
        <IMAGE>nate456.jpg</IMAGE>
        <DESCRIPTION>Going up for a dunk</DESCRIPTION>
        <PLAYER>Nate Robinson</PLAYER>
    </GALLERY>
    <GALLERY TEAM="KNICKS">
        <IMAGE>nate451.jpg</IMAGE>
        <DESCRIPTION>An excited Nate Robinson</DESCRIPTION>
        <PLAYER>Nate Robinson</PLAYER>
    </GALLERY>
    <GALLERY TEAM="KNICKS">
        <IMAGE>nate452.jpg</IMAGE>
        <DESCRIPTION>Shake and Bake</DESCRIPTION>
        <PLAYER>Nate Robinson</PLAYER>
    </GALLERY>
    <GALLERY TEAM="BULLS">
        <IMAGE>jordan-01.jpg</IMAGE>
        <DESCRIPTION>Air Jordan</DESCRIPTION>
        <PLAYER>Micheal Jordan</PLAYER>
    </GALLERY>
    <GALLERY TEAM="BULLS">
        <IMAGE>jordan-02.jpeg</IMAGE>
        <DESCRIPTION>Air Jordan</DESCRIPTION>
        <PLAYER>Micheal Jordan</PLAYER>
    </GALLERY>
    <GALLERY TEAM="BULLS">
        <IMAGE>jordan-03.jpg</IMAGE>
        <DESCRIPTION>Air Jordan</DESCRIPTION>
        <PLAYER>Micheal Jordan</PLAYER>
    </GALLERY>
    <GALLERY TEAM="BULLS">
        <IMAGE>jordan-04.jpg</IMAGE>
        <DESCRIPTION>Air Jordan</DESCRIPTION>
        <PLAYER>Micheal Jordan</PLAYER>
    </GALLERY>
</GALLERY>

Everything works fine but what I want to do is populate a combo box with the different teams so the user can sort which team gallery they are looking at.

Now the following


trace(gallery..*.@*);

Returns


KNICKSKNICKSKNICKSBULLSBULLSBULLSBULLS

Which obviously doesn’t help. I would at the very least have to be able to add a delimiter so I could just split and push into an array. How can I separate these attributes?

Thanks in advance