# How to delete/release XML object?

**URL:** <https://forum.kirupa.com/t/how-to-delete-release-xml-object/233487>\
**Category:** flash\
**Created:** [July 24, 2007, 1:48pm UTC](https://forum.kirupa.com/t/how-to-delete-release-xml-object/233487 "2007-07-24T13:48:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![psych](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/psych/32/2839_2.png) [@psych](https://forum.kirupa.com/u/psych)\
**Post date:** [July 24, 2007, 1:48pm UTC](https://forum.kirupa.com/t/how-to-delete-release-xml-object/233487/1 "2007-07-24T13:48:30Z")

</div>

I am loading xml file with following AS 3.0 code:

```auto
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:

```auto
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 still 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
