Accessing an Attribute

I have some XML that is structured like this:


<quiz>

    <item category="Health">
        <question>Can you override medication orders?</question>
        <answers>
            <answer>First answer</answer>
            <answer>Second answer</answer>
            <answer>Third answer</answer>
            <answer status="correct">Fourth anser</answer>
        </answers>
        <correctFeedback><b>That's correct!</b></correctFeedback>
        <incorrectFeedback><b>Incorrect.</incorrectFeedback>
    </item>

</quiz>

This is part of a multiple choice quiz. The correct answer was originally set to be the first item listed, but I want to change that so that the correct answer is determined by the “answer” node with an attribute “status” set to “correct”:


correctAnswer = dataXML.item[questionNum].answers.answer[0];
//correctAnswer = dataXML.item[questionNum].answers.answer.*.(@status == "correct");
//trace(dataXML.item[questionNum].answers.answer.attribute("correct"));
//trace(dataXML.item[questionNum].answers.answer.(@status=="correct"));
answers = shuffleAnswers(dataXML.item[questionNum].answers);

I’ve tried various things but I either get empty output (I assume that means null), or I get ReferenceError: Error #1065: Variable @status is not defined. Can anyone tell me what the correct syntax would be?

(Note that tracing correctAnswer = dataXML.item[questionNum].answers.answer[0]; gives the node value of the first answer node)