Fixed example in the serialization docs
Fixed name of the function
Turn this into a doctest block
Merge pull request #1256 from alex/serialization-docs

Fixed example in the serialization docs