You could use some library that will do it for you. If you are working on Windows platform, you could use MSXML which is part of the system already.
Check this question: Read Write XML File In C++
Other popular libraries: xerces, tinyxml, rapidxml
You will need a XML Parser. There are a bunch out there:
My personal favorite is pugiXML but that is a question of personal preference.
boost property tree works very well with xml, I would use that.