XElement 确实有 Element 方法 ,但需要一个 XName 作为唯一参数,而不是char数组。通过 XName 实例而不是 "location" 并且错误应该消失。
XElement
Element
XName
"location"