Flash AS2 and XML question

Hi experts,

I’m trying to build a Flash page using external XML. I have absolutely NO experience with XML but I’ve been fiddling with snippets all day, and I’ve come up with the following:

AS2:

[COLOR=DarkRed][INDENT]contents();
function contents() {
var cont:XML = new XML();
cont.ignoreWhite = true;
cont.onLoad = function(success) {
if (success) {
var root:XMLNode = this.firstChild;
var nameText:String = root.childNodes[0].nodeValue;
var introText:String = root.childNodes[1].nodeValue;
theText.titleText.htmlText = nameText;
theText.textText.htmlText = introText;
}
}
cont.load(“xml/home.xml”);
}[/INDENT][/COLOR]

XML:[INDENT][COLOR=DarkRed]<?xml version=“1.0”?>
<title><![CDATA[My Title]]></title>
<text><![CDATA[Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut gravida elit vel pede. Sed nec nibh ac lacus convallis elementum. Quisque laoreet arcu quis nibh.]]></text>[/COLOR][/INDENT]Now, the Title works fine, but the body text doesn’t – it just keeps coming up with ‘undefined’.

Can anyone spot any errors in this? please help, I’m pulling me hair out!