Combining object array and accessing object property name

I have an xml say in following format


     <color>
 <colorName>red,blue,green</colorName>
 <hexValue>0xffffff,0x0000,0xcdeff,</hexValue>
</color>
 

I load the xml and parse it in following manner


     for(var i:int =0;i<xmlList.length();i++)
{
  var nodeName:String = xmlList*.name();    
  //here datalength =3
  var nodeArray:Array = nodeData.split(",",dataLength);
 //now I loop through this nodearray to creat an object array
   for(var j:int =0;j<nodeArray.length;j++)
     {
    dataArray.push({nodeName:nodeArray[j]});
     }
  //now I push this dataArray into my final Array
  mainArray.push(dataArray);
}


Now what I want to do is create an array in following format based upon above code


     myArray.push({colorName:value,hexValue:value});
i.e. it should store values in following format
myArray[0].colorName  = red;
myArray[0].hexValue =oxfffff;
// here i should dynamically get colorName as object property and so its value 

</div>

What I should do is parse an xml and from its node name create object property and then create an object array based on those property.
Am I able to make myself clear.
I am still looking for solution and if I find I will post here.I am submitting this query if anyone has certain idea on how to implemnt it