public void LoadFromSingleXmlFile(ProjectBase project, XmlDocument document, string templateFilename)
        {
            XmlElement root = document.DocumentElement;
            if (root == null) throw new DeserialisationException("Designer Project XML does not contain MegaProject root node.");

            // Get each of the XmlElements corresponding to the individual files.
            var projectNode = root.SelectSingleNode("Project");
            var apiExtensions = root.SelectSingleNode("AllApiExtensions");
            var functions = root.SelectSingleNode("Functions");
            var userOptions = root.SelectSingleNode("UserOptions");
            var staticFiles = root.SelectSingleNode("StaticFiles");
            var outputs = root.SelectSingleNode("Outputs");

            ReadProject(projectNode, project, templateFilename);

            // force the project to load its references
            #pragma warning disable 168
            var list = project.ReferencedAssemblies;
            #pragma warning restore 168

            ReadFunctions(functions, project);
            ReadAllApiExtensions(apiExtensions, project);
            ReadUserOptions(userOptions, project);
            project.AddIncludedFiles(ReadStaticFilesDetails(staticFiles));
            project.RootOutput = ReadOutputs(outputs);

            project.SetupDynamicfilesAndFolders();
        }