Possible to Read/Write Network session to a file?

I am looking into being able to playback the actions of a game from file. Currently I am using a primitive XML reader/writer but it is quite a chore to maintain.

Since I plan on setting up server-authoritative networking anyway it strikes me that a simple solution would be to write the network data to file as well as (or instead of in single player) sending it across the network. Then playback would be 'just' replaying the contents of the file as if the server were sending it.

Is this possible with current Unity networking?

With Unity networking natively; no. Unless maybe if you track all rpcs and Onserialize calls yourself (add a call to your recorder, with timestamp, function delegate, variables..). But your better of with some game replay class then instead (e.g. my Game replay project like here: www.m2h.nl/unity)