public static XElement SaveModels() { var xml = new XElement("Models"); foreach (ModelInfo model in models) { var elem = new XElement("Model", new XElement("Position", Util.ConvertVector3ToString(model.position)), new XElement("Rotation", Util.ConvertQuaternionToString(model.rotation)), new XElement("LocalScale", Util.ConvertVector3ToString(model.localScale)), new XElement("ModelType", (int)model.modelType), new XElement("MenuFileName", model.menuFileName), new XElement("ModelName", model.modelName), new XElement("ModelIconName", model.modelIconName)); xml.Add(elem); } return(xml); }