Serialize a model to xml format string