public static string GetXML(this SvgDocument doc) { var ret = ""; using (var ms = new MemoryStream()) { doc.Write(ms); ms.Position = 0; var sr = new StreamReader(ms); ret = sr.ReadToEnd(); sr.Close(); } return ret; }