} // SaveTo public static string SaveAsString(this RecordTask task) { var buffer = new StringBuilder(); task.SaveTo(buffer); return(buffer.ToString()); } // SaveAsString
} // SaveAsString public static void SaveTo(this RecordTask task, StringBuilder buffer) { using (var writer = XmlWriter.Create(buffer, new XmlWriterSettings() { Indent = true })) { task.SaveTo(writer); } // using } // SaveTo