//Generate XML from the current UMLTabItem private XmlDocument GetDoc() { string assertion = ""; if (AssertionNode.Tag != null) { assertion = AssertionNode.Tag.ToString(); } Dictionary <string, StateDiagram> diagrams = new Dictionary <string, StateDiagram>(); foreach (TreeNode node in DiagramsNode.Nodes) { diagrams.Add(node.Name, new StateDiagram(node.Name, (node.Tag as StateDiagram).XmiContent)); } UMLModel umlModel = new UMLModel("UMLModel", diagrams, assertion); return(umlModel.GenerateXML()); }