the following code writes to an xml document. the problem is it writes everything to the same line. when i go to parse the xml doc i get an error. i would like to modify this code to write each node to it own line.

not following the humans thing but here goes. i grap an exisiting doc and parse it in a CFC

<cfhttp url="messages.xml " method="GET">

<cfset xApps = XmlParse(cfhttp.FileContent)>

i grab data from a form and insert it into the xml doc. that works fine. when i try to modify the xml a second time

it gives me a parsing error. if i update the newly written data on the xml doc manually, placing each node on its own line the xml doc will update. this is how i know my data is correct but formatting is not

Is this an actual copy from your output, or did you type this in? If the former, then the problem is the <messageList>...</messagelist> tags. While the XML specification indicates it is to be white space agnostic, it is also to be case sensitive. Thus the <messageList> with an upper case 'L" and </messagelist> with a lower case 'l" are not matching tags.

Upon fixing the case issue the following code worked just as expected on my system.

If the case of the "L" was just a typo in the forum post, then the problem might be with actual data? Again is this the actual output or is a simplified example where the actual output might contain special characters such as ampersand "&" characters?

If this is the case, you may not be able to just cut and paste the XML from a browser and parse it.

i cleaned up the data on my xml file to simplify it and make it easier to debug. I also update code to include charset value. my xml doc is updating correctly now. thank you for your time and help with this issue