how to write a simple xml file

Hi !

I want to write a simple xml file such as:

  
  
<settings>  
        <name> name </name>  
        <properties>  
                     <p1> property1 </p1>  
                     <p2> ... </p2>  
                     .....  
         </properties>  
<settings>  
  

I have taken a look to the wiki and the xmlSettingsExample, but if I try to do any addTag, addValue, setValue, i get a segmentation fault.

Besides, there are some things I dont understand, first why we need tagNum, what it does? second, what is the difference between pushtag / poptag and addtag?

Can anyone show me any simple example ?

Thanks a lot !