# Return XML after it's loaded

**URL:** <https://forum.kirupa.com/t/return-xml-after-its-loaded/213432>\
**Category:** flash\
**Created:** [January 19, 2007, 2:40pm UTC](https://forum.kirupa.com/t/return-xml-after-its-loaded/213432 "2007-01-19T14:40:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xenel](https://avatars.discourse-cdn.com/v4/letter/x/bbe5ce/32.png) [@xenel](https://forum.kirupa.com/u/xenel)\
**Post date:** [January 19, 2007, 2:40pm UTC](https://forum.kirupa.com/t/return-xml-after-its-loaded/213432/1 "2007-01-19T14:40:19Z")

</div>

I searched the forum but didn’t quite find what I was looking for.  
I am trying to write a method that loads any xml file and returns it to the caller.  
What I want: (It’s not working, I know it’s merely a concept)

```auto
private function makeCall ( xmlPath: String ) : XML
{
    var xml : XML = new XML ();
    xml.ignoreWhite = true;
    xml.onLoad = function ( success : Boolean)
    {
        if ( success ) return this; // As in return XML to the caller
    }
    xml.load ( xmlPath );
}

```

Any ideas?  
Regards.
