How to save c++ object into a xml file and restore back?
Serialization is a complex topic which is probably too much for a simple answer on SO. Unfortunately with C++, you don't get it for free as in other languages.
See the C++ faq lite or boost for a start.