eninyo - 2007-10-08

hello,
i'm using TinyXml anf i have this simple aml file (which i created manually):

<messagesDB>
      <connect />
      <login />
      <assign />
      <data />
</messagesDB>

all i want to do is to add child let say under login child.

so i have an element to the root (messagesDB), i get from it the node "login", convert the node to element (using the ToElement() function) and i want to add it anew msg so i'm using InsertEndChild() function.

at the first time (when the file looks like above) i get a good result looks like this:
<messagesDB>
      <connect />
      <login>
           <new message>example text</new message>
      </login>
      <assign />
      <data />
</messagesDB>

but when i run the same code again, i expect (want) that another (same message) will be added under the last one in the login section. unfortunaatly, it doesn't!

i get this:
<messagesDB>
      <connect />
      <login>
           <new />
           <new message>example text</new message>
      </login>
</messagesDB>

does anyone know why the last two is deleted?(the assign and the data nodes)
how can i add it as i want? some example...

tnx in advance,
Eli