public XElement ToXElement() { XElement OSChemaElement = new XElement("Model"); XElement OTablesElement = new XElement("Tables"); XElement ODatabasesElement = new XElement("Databases"); OSChemaElement.Add(OTablesElement); OSChemaElement.Add(ODatabasesElement); foreach (String OKey in FAdddionalMetadata.Keys) { OSChemaElement.Add(new XAttribute(OKey, FAdddionalMetadata[OKey])); } foreach (Table OTable in FTables.Values) { OTablesElement.Add(OTable.ToXElement()); } foreach (Database ODatabase in FDatabases.Values) { ODatabasesElement.Add(ODatabase.ToXElement()); } return(OSChemaElement); }