Instead of XMLList, I'd suggest using XMLListCollection. And then as each XML file is loaded, add its contents to the collection using the addItem() method.
Why don't you use the Data centric workflows which will help you to deal with multiple XML files as AS objects? Something like this
1. Create a HTTPService using Data menu -> Connect to HTTPService
2. create a operation getRecipe and enter your URL example URL: http://myserver/recipe?name=recipename
3. Use Configure Return Type to tell that this method returns a Recipe class
4. Use DataBinding to bind the result of this to a DataGrid
Call the following in a loop and
recipeName = myRecipes+ // All of your recipe names, Recipe is a ArrayCollecition
Recipe.setAt(i) = Svc1.getRecipe(recipeName);
At the end you would have a Recipe
This is one of the ways you could work instead of having a XMLListCollection and use e4x etc. to go through your collection.
Let us know if this helps, or you are looking for something else.
>My main question here is how do I load each XML file and add it to the same XMLList?
I assume that you have to much data to load at once. I would load a recipe each time you click on it in a list when you want to see or edit it. Use a HTTPService with prop resultFormat set to 'array' for the whole list and to 'object' for a recipe details.
This is just a simple solution when you work with ObjectProxies to store your data in. More advanced would be if you would serialize your data into classes and replace the objects in the list based on a ID
- When receiving the result of the list of recipes the xml is deserialized into an ArrayCollection with ObjectProxies.
- When receiving the result of recipe details I would find and replace the orginal object the retrieved ArrayCollection with recipes.setItemAt(newDetailRecipe, recipes.getItemIndex(compactRecipe)); The compact Recipe you kept waiting for the result to return from your http service.