Serialization of trie.