You're going to have to write it yourself, but it should follow the QDataStream class. And if you do, you could use it interchangeably.

There is a problem you will need to tackle though XML is a structured, nested format. QDataStream is only bytes. Therefore when choosing your XML schema, you will be very limited. While not impossible, you'd probably be left with a rather rudimentary set of elements and attributes. You could always map to/from a higher level, but that would be more work.