I think, XML.replace
isn't a proper choice in this case, it will replace all Settings
nodes. You can use this more forward solution:
var xml:XML = <SETTINGS>
<Settings Title="choice1">Home</Settings>
<Settings Title="choice2">Options</Settings>
</SETTINGS>;
trace("before\n", xml);
xml.Settings.(@Title == "choice1").* = "Home2";
xml.Settings.(@Title == "choice2").* = "Options2";
trace("after\n", xml);
outpout:
before
<SETTINGS>
<Settings Title="choice1">Home</Settings>
<Settings Title="choice2">Options</Settings>
</SETTINGS>
after
<SETTINGS>
<Settings Title="choice1">Home2</Settings>
<Settings Title="choice2">Options2</Settings>
</SETTINGS>