+1  A: 
switch (element.student_state.toString()) {...

You need the value of the xml element, not the element itself for the comparison.

chrissr
Thanks but still the form does not display. I do get an error "can not resolve a multiname reference unambiguously spark.components:TextInput" from this line of code: import mx.controls.TextInput;
JohnMerlino
A: 

Ok I think I see the problem now,

for each (var element:XML in students)

will only loop once, because the whole students XML is in students, which has no student_state property, you probably mean

for each (var element:XML in students.children())

then you are looping on the student node, which does have the child student_state. So that should work, even without the toString() method (not sure on that point, so you might want to try it both ways).

Familiarize yourself with trace() which you can use to output info to the console. if you had added a trace(element.toXMLString()) inside your for loop you would have seen this for yourself.

invertedSpear
.children() was the solution. Thanks.
JohnMerlino
+1  A: 

You had a couple of errors stacked on top of one another - I believe your most recent one - the multiname reference error - has to do with more than one class with the same name (TextInput) being referenced in your code. Could be that flex is adding an import statement to one automatically at the head of your class.