function Test-NuspecManifest
            Tests a Nuspec manifest.
            Tests a Nuspec manifest against an xsd schema.
        .PARAMETER Path
            A string containing the full path to the Nuspec manifest file.
        .PARAMETER Nuspec
            An XmlDocument containing the Nuspec manifest.
        .PARAMETER Schema
            A string containing either the content or the full path of the xsd schema.
            Will use 'Get-NuspecSchema' if omitted.
            Returns a boolean specifying whether or not the manifest is conform to teh schema.
            Test-NuspecManifest -Path .\package.nuspec -Schema .\nuspec.xsd
            This example will test the file 'package.nuspec' against the schema 'nuspec.xsd'.
            Test-NuspecManifest -Nuspec $NuspecContent
            This example will test the xml document contained in a variable against the default Nuspec schema.

        [Parameter(ParameterSetName = "FromFile", Mandatory = $true)]
        [ValidateScript( { Test-Path $_ } )]
        [string] $Path,
        [Parameter(ParameterSetName = "FromXml", Mandatory = $true)]
        [xml] $Nuspec,
        [Parameter(ParameterSetName = "FromFile", Mandatory = $false)]
        [Parameter(ParameterSetName = "FromXml", Mandatory = $false)]
        [string] $Schema = (Get-NuspecSchema)

        $CleanTmp = $false
        if ($PSCmdlet.ParameterSetName -eq "FromXml")
            Write-Verbose "Saving Nuspec xml in a temporary location ($(([System.IO.Path]::GetTempPath()))/temp.nuspec)."
            $NuspecPath = Join-Path ([System.IO.Path]::GetTempPath()) "temp.nuspec"
            $CleanTmp = $true
            $Path = $NuspecPath
        if (!(Test-Path $Schema))
            Write-Verbose "Saving Nuspec schema in a temporary location ($(([System.IO.Path]::GetTempPath()))/nuspec.xsd)."
            $XsdPath = Join-Path ([System.IO.Path]::GetTempPath()) "nuspec.xsd"
            $Schema | Out-File $XsdPath -Encoding utf8
            $Schema = $XsdPath
        Write-Verbose "Testing Nuspec manifest '$Path' against schema '$Schema'"
        Test-Xml -Path $Path -SchemaPath $Schema
        Write-Error $_
        if ($XsdPath -and (Test-Path $XsdPath)) { Remove-Item $XsdPath -Force }
        if ($CleanTmp) { Remove-Item $NuspecPath -Force }