There are few things you need to decide first:
1- Structure of xml file that you want to write, it may be something like this:
<people>
<name>John</name>
<age>26</age>
</people>
<people>
<name>xyz</name>
<age>28</age>
.
.
</people>
Or you can come up with something else
2- When the data needs to be written in xml file, immediately after one set of data is captured or only at the end when all data sets are captured.
After this you can use following link to write data into xml file:
http://forum.codecall.net/csharp-tutorials/31315-c-tutorial-reading-writing-xml-files.html
Hope it helps...