Passing variables to function via XML

Group,
Working on a project where we have a flash player embedded in a CFM page, the player calls the product videos from the itemID passed in the URL of the CFM page. We are trying to make the list of subnodes dynamic by taking them out of the hard-coded flash file and making a dynamic list (probably XML) that flash could pull in. I have included the snippets of the current hard-coding below, with the functions and how the variables are currently coded, I could really use your help guys! Thanks in advance for your help!

if (itemID == undefined) {
_global.itemID = 0;
} else {
_global.itemID = itemID;
}
_global.currentItemID = -1;

function addBrandNode(desc) {
_global.brandAdded = false;
_global.brandName = desc;
}
function addTheRealBrand() {
if (_global.brandAdded == false) {
trace("adding brand: "+_global.brandName);
_global.brandAdded = true;
_global.brandIndex++;
_global.productIndex = -1;
}
}
function addGeneralProductNode(brandName, desc) {
if (_global.brandName == brandName && _global.brandAdded == true) {
addProductNode(desc, 0);
}
}
function addProductNode(desc, theItemID) {
if (_global.itemID == 0 or _global.itemID == theItemID or theItemID == 0) {
trace(“adding product: “+desc+”:”+theItemID);
addTheRealBrand();
_global.currentItemID = theItemID;
_global.productIndex++;
return true;
} else {
_global.currentItemID = -1;
}
return false;
}
function addSubNode(desc, video) {
if (_global.itemID == 0 or _global.itemID == _global.currentItemID or _global.currentItemID == 0) {
trace(“adding subnode: “+_global.currentItemID+”:”+desc);
tmpArray = new Array();
tmpArray.push(desc, video);
_global.videoArray.push(tmpArray);
}
}
_global.brandIndex = -1;
_global.productIndex = -1;
_global.videoIndex = -1;
_global.videoArray = new Array();
//// capresso
addBrandNode(“Capresso”);
addProductNode(“C1000”, 13);
addSubNode(“Promo”, “c1000”);
addProductNode(“CoffeeTeam Luxe”, 91);
addSubNode(“Intro”, “capctl_intro”);
addSubNode(“Cleaning”, “capctl_clean”);
addSubNode(“Grinding”, “capctl_grinding”);
addProductNode(“CoffeeTEC”, 87);
addSubNode(“Intro”, “capctec_intro”);
addSubNode(“Cleaning”, “capctec_clean”);
addSubNode(“Frothing Milk”, “capctec_froth”);
addSubNode(“Hot Chocolate”, “capctec_hotchoc”);
addSubNode(“Water Reservoir”, “capctec_water”);
addProductNode(“S9”, 9);
addSubNode(“Intro”, “caps9_intro”);
addSubNode(“Brewing Espresso”, “caps9_brew”);
addSubNode(“Using FrothXpress”, “caps9_fxpres”);
addSubNode(“Cleaning Frother”, “caps9_clean”);
addSubNode(“Cleaning FrothXpress”, “caps9_fxpresclean”);
addSubNode(“Making a Latte”, “caps9_latte”);
addSubNode(“Frothing Milk”, “caps9_froth”);
addSubNode(“Claris Water Filter”, “caps9_claris”);
addProductNode(“Ultima”, 41);
addSubNode(“Intro”, “capult_intro”);
addSubNode(“Brewing Espresso”, “capult_espresso”);
addSubNode(“Cleaning”, “capult_clean”);
addSubNode(“Cleaning Tray”, “capult_tray”);
addSubNode(“Empty Grounds”, “capult_grounds”);