# Why use parseXML?

**URL:** https://forum.kirupa.com/t/why-use-parsexml/230832
**Category:** programming
**Created:** [June 29, 2007, 9:04am UTC](https://forum.kirupa.com/t/why-use-parsexml/230832 "2007-06-29T09:04:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![NickZA](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nickza/32/3452_2.png) [@NickZA](https://forum.kirupa.com/u/NickZA)
#### Post date: [June 29, 2007, 9:04am UTC](https://forum.kirupa.com/t/why-use-parsexml/230832/1 "2007-06-29T09:04:16Z")

</div>

Hi

I’m a little confused about using XMLparse.

I’m making use of Zinc to write out to an XML file, but I don’t know if it is actually necessary to parse the XML before writing the characters out to file… :h:

Because it seems to me like it’ll make no difference whatsoever – I can send out the XML unparsed, and as long as I do it right, there’ll be no errors, right? It’ll be just the same?

Perhaps there’s something I don’t understand here - if so please clarify for me.

I found an article at [http://www.communitymx.com/content/article.cfm?cid=107B6](http://www.communitymx.com/content/article.cfm?cid=107B6) with the following code showing how it’s done, but it looks as if I could just put the string in directly since it simply converts the XML object to a string anyway…? Here is the code:

```auto
import mdm.FileSystem;

var xml:XML = new XML();
xml.parseXML("<data>sample data</data>");

var filePath:String = FileSystem.getCurrentDir() + "sample.xml";
FileSystem.saveFile(filePath, xml.toString());

```

Thank you. Here is a spotted egg for your trouble. 🥚

-Nick
