public static Solution[] ToArray(this XmlDocument document)
        {
            var solutions = new List<Solution>();

            foreach (XmlElement element in document.DocumentElement.ChildNodes)
            {
                var solution = new Solution
                {
                    Version = new Version(element.Attributes[Constants.Xml.VERSION].Value),
                    UniqueName = element.Attributes[Constants.Xml.UNIQUE_NAME].Value,
                    FriendlyName = element.Attributes[Constants.Xml.FRIENDLY_NAME].Value
                };

                solutions.Add(solution);
            }

            return solutions.ToArray();
        }
        private void Load(XmlDocument document)
        {
            var solutions = new List<Solution>();
            var assemblies = new List<PluginAssembly>();

            this.Solutions = solutions.ToArray();
            this.Assemblies = assemblies.ToArray();

            foreach (XmlElement element in document.DocumentElement.ChildNodes)
            {
                if (element.Name == Constants.Xml.SOLUTIONS)
                {
                    foreach (XmlElement solution in element.ChildNodes)
                    {
                        try
                        {
                            var item = new Solution
                            {
                                Version = new Version(solution.Attributes[Constants.Xml.VERSION].Value),
                                UniqueName = solution.Attributes[Constants.Xml.UNIQUE_NAME].Value,
                                FriendlyName = solution.Attributes[Constants.Xml.FRIENDLY_NAME].Value
                            };

                            solutions.Add(item);
                        }
                        catch (NullReferenceException)
                        {
                            // Hiding import errors
                        }
                    }

                    this.Solutions = solutions.ToArray();
                }

                if (element.Name == Constants.Xml.ASSEMBLIES)
                {
                    foreach (XmlElement assembly in element.ChildNodes)
                    {
                        try
                        {
                            var item = new PluginAssembly()
                            {
                                Version = new Version(assembly.Attributes[Constants.Xml.VERSION].Value),
                                FriendlyName = assembly.Attributes[Constants.Xml.FRIENDLY_NAME].Value,
                                UniqueName = assembly.Attributes[Constants.Xml.UNIQUE_NAME].Value
                            };

                            assemblies.Add(item);
                        }
                        catch (NullReferenceException)
                        {
                            // Hiding import errors
                        }
                    }

                    this.Assemblies = assemblies.ToArray();
                }
            }
        }