/// <summary> /// Exports the tree. /// </summary> /// <param name="root">The root element.</param> /// <param name="includeRoot">if set to <c>true</c> the also export the root element, else /// if set to <c>false</c>, then the children are exported.</param> public void ExportTree(EATree root, bool includeRoot) { m_XmlDocument = new XmlDocument() { XmlResolver = null }; XmlDocumentFragment xmlFragment = m_XmlDocument.CreateDocumentFragment(); DocBookFormat format = new DocBookFormat(); if (includeRoot) { XmlNode xnode = ExportElement(root, format); xmlFragment.AppendChild(xnode); } else { foreach (EATree child in root.Children) { XmlNode xnode = ExportElement(child, format); xmlFragment.AppendChild(xnode); } } xmlFragment.WriteContentTo(m_XmlWriter); }