You're ignoring this:
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
That sets the default namespace for descendants. So you want:
XNamespace ns = "http://schemas.microsoft.com/developer/msbuild/2003";
var elem = doc.Descendants(ns + "Project")
.Where(t => t.Attribute("ToolsVersion")!=null)
.Elements(ns + "ItemGroup")
.Elements(ns + "Reference")
.Where(r => r.Attribute("Include") != null);