I am loading xml file with following AS 3.0 code:

var myXML:XML = new XML();
var myXMLURL:URLRequest = new URLRequest("input.xml");
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener(Event.COMPLETE, xmlLoaded);
And afterward in "xmlLoaded()" function i am parsing loaded xml file and using apollo filesystem api for writing to that same "input.xml" file but when i do that i get this error:

Error #2158: File or directory is in use
So my guess is that i have to destroy or release somehow my XML object which is connected to my "input.xml" file but i am not sure how to do that. I tried to delete it with "delete" keyword but then realized i can only use it for deleting properties. Can someone help me with this please?

thank you