1
我有以下XML字符串:寫作的LINQ to XML查詢過濾一個XML字符串
<report>
<item id="4219" Co="6063" LastName="Doe" FirstName="John"/>
<item id="2571" Co="6063" LastName="Doe" FirstName="Jane"/>
</report>
我怎樣寫一個LINQ到通過名稱=「簡」過濾器和寫回一個XML查詢XML字符串
我有下面的代碼至今:
XDocument reportXmlDoc = XDocument.Parse(_report); //This is the string var assigned with data above
var filteredList = from x in fullReportXmlDoc.Descendants("item")
where x.Attribute("FirstName").Value == "Jane"
select x;
如何轉換filteredList回一個XML字符串?