Writing your own parser is not a great idea in my opinion.
You can use some library for that. For example, tinyxml (http://github.com/leethomason/tinyxml2 ) or Qt (it's a fully fledged cross-platform GUI framework, but it also has an XML module - http://qt.nokia.com/ ).
You can read/write XML very easily using this. I just linked you the tutorial I used way back when, you can grab the latest boost from their website, I don't think it requires anything but headers.