XmlReader question

I discovered the XMLReader plug in 3.1rc1, and it looks like an excellent tool!
So now I’m trying to parse an XML from a string, but I get a ‘no public instance field or method’ error when I run getAttributeNames().
I tried a method that looks like this:

var myXML = []
myXML[0] = plugins.XmlReader.readXmlDocumentFromString(forms.myForm.field_xml)
var x = myXML[0].getAttributeNames()

I’m a newbee on XML parsing, so I suppose my code isn’t correct… :?

try this:

var myXML = plugins.XmlReader.readXmlDocumentFromString(forms.myForm.field_xml)
var x = myXML[0].getAttributeNames()