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.
Boost's serialization library might be implementing a lot of the functionality you are looking for.
I don't know if any direct way of achieving this. You can write separate methods to serialize and de-seriealize methods in which individual data members of the object need to be written and extracted from the file.
Boost.Serialization and libs11n can both do this. The libs11n manual (available here) has an extensive comparison of the two.
As Tobias said, the C++ FAQ has good background information.