XML is serialization. It's just an output format -- other formats could be binary data, JSON, INI, ...
With a well designed library (such as boost.serialization) the serialization functions and the output format are completely separated. You only have to write your serialization functions once, in a generic way, and then you can output the result to many different formats.