add serialize.cpp

support XML and YML