XML preloader function

I was playing round with some loading code that I (with alot of help from lostinbeta) made a while ago. I got it to load two XML files seperatly, but I had to use all the loading code twice. I really wanted to be able to put it inside a function, so that the code would be cleaner and easier to customize. Something like:

function loadXML(xmlfile, xmlname) {
// Code for loader here
 }

So I could call it like:

loadXML("html/scripts/news.xml, "newsXML")

Anyone know how to do that?

(The .fla only loads one XML file. It’s just to show you the code that’s supposed to do it)

EDIT: the fla should now work on Flash XM 2004.