RealSelf Interview Question

How would you go about serializing/deserializing a tree?