title: TinyXml append to xml file
body: <p>I have been working on a project for a few months now and my main issue i am having right now is appending to an xml file. I can create the files no problem. But i want to be able to add more data. Basically use it like a small database.</p>
  
  <p>The code included is only a small part of the whole program but i believe it is in here i need help with to figure out the process to append to the file. Each element takes user input without any issues. but when they go to write a second Horse tot he file is wipes out the old one and make a whole new file.</p>
  
  <p>Any suggestions on how to append would be great</p>
  
  <pre><code>void WriteThisHorseToFile(char* horseName, char* horseMother, char* horseFather, char* horseHeight, 
                        char* horseOwner, char* horseAge, char* horseWins, char* horseMarkings, char* horseNotes)  
  {  
  
  TiXmlDocument doc;
  TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" );  
  doc.LinkEndChild( decl );  
  
  TiXmlElement * root = new TiXmlElement( "Horses" );  
  doc.LinkEndChild( root );
  
  TiXmlElement * element2 = new TiXmlElement( "Name" );  
  root-&gt;LinkEndChild( element2 );  
  
  TiXmlText * text2 = new TiXmlText(horseName);  
  element2-&gt;LinkEndChild( text2 );  
  
  TiXmlElement * element3 = new TiXmlElement( "Mother" );  
  element2-&gt;LinkEndChild( element3 );  
  
  TiXmlText * text3 = new TiXmlText(horseMother);  
  element2-&gt;LinkEndChild( text3 );  
  
  TiXmlElement * element4 = new TiXmlElement( "Father" );  
  element2-&gt;LinkEndChild( element4 );  
  
  TiXmlText * text4 = new TiXmlText(horseFather);  
  element2-&gt;LinkEndChild( text4 );  
  
  TiXmlElement * element5 = new TiXmlElement( "Height" );  
  element2-&gt;LinkEndChild( element5 );  
  
  TiXmlText * text5 = new TiXmlText(horseHeight);  
  element2-&gt;LinkEndChild( text5 ); 
  
  TiXmlElement * element6 = new TiXmlElement( "Owner" );  
  element2-&gt;LinkEndChild( element6 );  
  
  TiXmlText * text6 = new TiXmlText(horseOwner);  
  element2-&gt;LinkEndChild( text6 );
  
  TiXmlElement * element7 = new TiXmlElement( "Age" );  
  element2-&gt;LinkEndChild( element7 );  
  
  TiXmlText * text7 = new TiXmlText(horseAge);  
  element2-&gt;LinkEndChild( text7 );
  
  TiXmlElement * element8 = new TiXmlElement( "Wins" );  
  element2-&gt;LinkEndChild( element8 );  
  
  TiXmlText * text8 = new TiXmlText(horseWins);  
  element2-&gt;LinkEndChild( text8 );
  
  TiXmlElement * element9 = new TiXmlElement( "Markings" );  
  element2-&gt;LinkEndChild( element9 );  
  
  TiXmlText * text9 = new TiXmlText(horseMarkings);  
  element2-&gt;LinkEndChild( text9 );
  
  TiXmlElement * element10 = new TiXmlElement( "Notes" );  
  element2-&gt;LinkEndChild( element10 );  
  
  TiXmlText * text10 = new TiXmlText(horseNotes);  
  element2-&gt;LinkEndChild( text10 );
  
  dump_to_stdout( &amp;doc );
  doc.SaveFile("demo2.xml"); 
  
  PressEnter();
  }
  </code></pre>