From https://stackoverflow.com/questions/18794264/visual-studio-how-to-serialize-object-from-debugger #debugging
(new System.Xml.Serialization.XmlSerializer(obj.GetType())).Serialize(new System.IO.StreamWriter(@"c:\temp\text.xml"), obj)