private static void WriteCompiledMainContent(WordMLTemplate t, XmlDocument xml)
{
using (var ms = new MemoryStream())
using (var writer = new XmlTextWriter(ms, Encoding.UTF8))
{
writer.Formatting = Formatting.None;
xml.WriteTo(writer);
writer.Flush();
ms.Flush();
t.PutBuffer(ms.ToArray());
}
}