How to do serialization?

I can’t find any examples on how to do serialization in nodes. If there isn’t a mechanism built-in for serialization, is there a common pattern used to implement it in Cocos2d-x?

Skimming through the code I found that maybe it can be accomplished by passing a subclass of Renderer to the method visit of the node I want to serialize.

Also there are some classes what use FlatBuffers to do de-serialization but cannot find anything similar for serialization.