Parse an XML file through actionscript

Howdy folks, I’ve been searching around for a few days now, and I’m trying to find a way to remove a line of XML through actionscript.

Background: I’m using an Infopath form that a user will fill out to create an XML document, which is then plugged into a flash file and will build a template based on what they selected.

The XML File:

<?xml version="1.0" encoding="UTF-8"?>
**<?mso-infoPathSolution solutionVersion="1.0.0.26" productVersion="11.0.6565" PIVersion="1.0.0.0" href="**[**file:///C:\Documents%20and%20Settings\ufsa\My%20Documents\Template4.xsn**](file:///C:\Documents%20and%20Settings\ufsa\My%20Documents\Template4.xsn)**" name="urn:schemas-microsoft-com:office:infopath:Template4:" language="en-us" ?>**
<dataroot generated="2006-09-25T15:24:01" xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance" xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xd="[URL="http://schemas.microsoft.com/office/infopath/2003"]http://schemas.microsoft.com/office/infopath/2003](http://www.w3.org/2001/XMLSchema-instance)">
 <course>
  <course_id>1</course_id>
  <course_title>df</course_title>
  <course_color>2</course_color>
  <is_testing>1</is_testing>
  <course_img>null</course_img>
  <modules>
   <module_id>3</module_id>
   <module_title>dgsfg</module_title>
   <course_id_fk>1</course_id_fk>
   <lessons>
    <lesson_id>2</lesson_id>
    <lesson_title>Lesson</lesson_title>
    <lesson_pages>3</lesson_pages>
    <mod_id_fk>3</mod_id_fk>
   </lessons>
  </modules>
 </course>
</dataroot>

the bolded line is where i’m getting snagged up. If it is manually removed, everything works fine. However manually removing it will end up being a PITA for the end user.

Here is the actionscript used:

[FONT=Helv][SIZE=2]
public function ripXML(my_xml:XML){
my_xml.ignoreWhite = true;
// extract first node to loop through
var tmpNode:XMLNode = my_xml.firstChild.firstChild;
//
// temp vars for the background movie;
// loop through children(modules)
for(var xm:XMLNode = tmpNode.firstChild;xm!=null;xm=xm.nextSibling){
// check for title
if(xm.nodeName == "course_title"){
courseTitle = xm.firstChild.toString();
}
if(xm.nodeName == "course_color"){
courseColor = Number(xm.firstChild.toString())
}
if(xm.nodeName == "is_testing"){
if(xm.firstChild.toString() == 1){
_root.isTesting = true;
trace("testing")
}else{
trace("live")
_root.isTesting = false;
}
}
if(xm.nodeName == "course_img"){
courseImg = xm.firstChild.toString();
 
}
if(xm.nodeName == "modules"){
// add new module to the modules_arr
var tmpModule:Module = new Module(xm);
modules_arr.push(tmpModule);
}
}
}
[/SIZE][/FONT]

Any help you could provide would be great.