/// <summary>
        /// Get the value of an attribute on a project element
        /// </summary>
        /// <param name="attributeName">Name of the attribute to get the value for</param>
        /// <returns>Value of the attribute</returns>
        public string GetMetadata(string attributeName)
        {
            if (this.IsVirtual)
            {
                // For virtual items, use our virtual property collection
                if (!virtualProperties.ContainsKey(attributeName))
                {
                    return(String.Empty);
                }
                return(virtualProperties[attributeName]);
            }

            // cannot ask MSBuild for Include, so intercept it and return the corresponding property
            if (String.Compare(attributeName, ProjectFileConstants.Include, StringComparison.OrdinalIgnoreCase) == 0)
            {
                return(MSBuildItem.GetEvaluatedInclude(item));
            }

            // Build Action is the type, not a property, so intercept this one as well
            if (String.Compare(attributeName, ProjectFileConstants.BuildAction, StringComparison.OrdinalIgnoreCase) == 0)
            {
                return(MSBuildItem.GetItemType(item));
            }

            return(MSBuildItem.GetMetadataValue(item, attributeName));
        }
        /// <summary>
        /// This is used when loading the project to loop through all the items
        /// and for each SubProject it finds, it create the project and a node
        /// in our Hierarchy to hold the project.
        /// </summary>
        internal protected void CreateNestedProjectNodes()
        {
            // 1. Create a ProjectElement with the found item and then Instantiate a new Nested project with this ProjectElement.
            // 2. Link into the hierarchy.
            // Read subprojects from from msbuildmodel
            __VSCREATEPROJFLAGS creationFlags = __VSCREATEPROJFLAGS.CPF_NOTINSLNEXPLR | __VSCREATEPROJFLAGS.CPF_SILENT;

            if (this.IsNewProject)
            {
                creationFlags |= __VSCREATEPROJFLAGS.CPF_CLONEFILE;
            }
            else
            {
                creationFlags |= __VSCREATEPROJFLAGS.CPF_OPENFILE;
            }

            foreach (MSBuild.ProjectItem item in MSBuildProject.GetItems(this.BuildProject))
            {
                if (String.Compare(MSBuildItem.GetItemType(item), ProjectFileConstants.SubProject, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    this.nestedProjectElement = new ProjectElement(this, item, false);

                    if (!this.IsNewProject)
                    {
                        AddExistingNestedProject(null, creationFlags);
                    }
                    else
                    {
                        // If we are creating the subproject from a vstemplate/vsz file
                        bool isVsTemplate = Utilities.IsTemplateFile(GetProjectTemplatePath(null));
                        if (isVsTemplate)
                        {
                            RunVsTemplateWizard(null, true);
                        }
                        else
                        {
                            // We are cloning the specified project file
                            AddNestedProjectFromTemplate(null, creationFlags);
                        }
                    }
                }
            }

            this.nestedProjectElement = null;
        }