public void Dispose() { if (RootWriter != null) { RootWriter.Dispose(); } if (XmlStream != null) { XmlStream.Dispose(); } }