public override TImport Import(string filename, ContentImporterContext context) { context.Logger.PushFile(filename); LevelSet project = new LevelSet(); Dictionary <int, object> objectIdDictionary = new Dictionary <int, object>(); XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(filename); XmlNode projectNode = xmlDocument.DocumentElement; objectIdDictionary[Convert.ToInt32(projectNode.Attributes["id"].Value)] = project; foreach (XmlNode child in projectNode.ChildNodes) { if (child.Name == "tiles") { foreach (XmlNode tileNode in child.ChildNodes) { project.AddTile(ParseTileNode(tileNode, project, objectIdDictionary)); } } } foreach (XmlNode child in projectNode.ChildNodes) { if (child.Name == "levels") { foreach (XmlNode levelNode in child.ChildNodes) { project.Levels.Add(ParseLevelNode(levelNode, project, objectIdDictionary)); } } } context.Logger.PopFile(); return(project); }