私のxmlは次のようになります:
<x>
  <y a1= "abc" a2= "xyz" a3="2" a4="4" a5="8"/>
  <y a1= "def" a2= "hij" a3="5" a4="10" a5="15"/>
</x>
次のコードは、私のxmlの値をフィルタリングし、結果を画面に出力します。
    static void Main(string[] args)
            {
                int first;
                int second;
                int third;
                XDocument doc = XDocument.Load(xmlFile);
                IEnumerable<XElement> rows = from row in doc.Descendants("x")
                                             where row.Attribute("a1").ToString() == "abc" & row.Attribute("a2").ToString() == "xyz"
                                             select row;
                foreach (XElement ele in rows)
                {
                    IEnumerable<XAttribute> aList = from att in ele.DescendantsAndSelf().Attributes()
                                                    select att;
                    foreach (XAttribute xatr in atrList)
                    {
                        Console.WriteLine(att);
                    }
                }
            }
        }
    }
結果を画面に表示する代わりに、フィルター処理された行の値a3、a4、およびa5を変数1、2、および3番目に割り当てます。また、a3、a4、a5の値を新しい値で上書きしたいと思います。