How can one write newline characters between TiXmLText elements in a Tiny XML DOM Object using Visual Studio 2008 C++?

I am using TinyXML library in my project to produce a Xml file. (C++ Visual Studio 2008).
I want to write each name in one line but all of them between a couple tags. I would like the output format below:
   <?xml version="1.0"?>
but I dont know How can I write the new line between them . by my code here:
  TiXmlDocument document;
  TiXmlElement* msg;
  TiXmlDeclaration* dec1 = new TiXmlDeclaration("1.0","","");

  TiXmlElement * root = new TiXmlElement( "opencv_storage" );  
  document.LinkEndChild( root );
  msg = new TiXmlElement("images");

  openFileDialog1->Title = "Select an Image file";

 if (openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK)

     for each (String^ file in openFileDialog1->SafeFileNames)
         std::stringstream v;
         v << openFileDialog1->FileName;
         TiXmlText* txt = new TiXmlText(v.str());


by this Code I produce such file :
 <?xml version="1.0" ?>
    <images>C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpgC:\Users\Public  \Pictures\Sample Pictures\Chrysanthemum.jpg
How Can I write a newline character between these names ?
Any help is greatly appreciated.
camster123Senior C++ Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark BullockQA Engineer IIICommented:
The newline character in C++ is \n

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
camster123Senior C++ Software EngineerAuthor Commented:
Thank you for the solution. I believe there is a difference in C++ between endl and '\n'
Mark BullockQA Engineer IIICommented:
I think endl will flush the buffer or stream.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.