What different serialization format? I thought serialization == string.
The byte stream can be a character stream in whatever encoding or a binary one.
https://en.wikipedia.org/wiki/Comparison_of_data_serializati... lists lots of binary serialization formats.
I tried to build something like that for rendering HTML, for the same reasons – security and proper structure. But, stupidly, I was working in PHP, and so its syntax was somewhat clunky. I still think it is a good idea, though.