private void Write(DrawingElement rootElement, IHtmlWriter writer)
        {
            var svgDocument = DiagramGenerator.ProduceSvg(rootElement);

            string svg;
            using (var stream = new MemoryStream())
            {
                svgDocument.Write(stream);
                svg = Encoding.UTF8.GetString(stream.GetBuffer(), 0, (int)stream.Length);
                svg = svg.Substring(svg.IndexOf("<svg", StringComparison.OrdinalIgnoreCase));
            }

            writer.GetTextWriter().Write(svg);
        }