Does this do it for you? Good old Descendants property.
string xmlInput = ...;
XDocument myDoc = XDocument.Parse(xmlInput);
//
List someElements = myDoc.Descendants("a").ToList();
someElements.ForEach(x => x.Value = "Foo");
//
Console.WriteLine(myDoc);
Hmm, I see you have an attribute in there. Can do that too:
string xmlInput = //...
XDocument myDoc = XDocument.Parse(xmlInput);
//
List someText =
myDoc.Descendants()
.Nodes()
.OfType()
.Where(x => x.Value.StartsWith("{") && x.Value.EndsWith("}"))
.ToList();
//
List someAttributes =
myDoc.Descendants()
.Attributes()
.Where(x => x.Value.StartsWith("{") && x.Value.EndsWith("}"))
.ToList();
//
someText.ForEach(x => x.Value = "Foo");
someAttributes.ForEach(x => x.Value = "Bar");
//
Console.WriteLine(myDoc);
Ah, now with what you're expecting, I will make it work:
List e = myDoc.Descendants("a").ToList();
e.Where(x => x.Attribute("name").Value == "username").Single().Value = "abc";
e.Where(x => x.Attribute("name").Value == "password").Single().Value = "abc";