Try setName method: I haven't used it, but the docs says it will work on attributes too.
var xml:XML = <record id="1" name="CustomerInfo">
<field name="id" index="1" type="String"/>
</record>;
xml.@name[0].setName("match");
trace(xml.toXMLString());
xml.field.@name[0].setName("match");
trace(xml.toXMLString());
Update: It works in Firefox e4x javascript, so it should work in ActionScript too. Try this:
var xml:XML = <record id="1" name="CustomerInfo">
<field name="id" index="1" type="String"/>
</record>;
var names:XMLList = xml.descendants("@name");//all `name` attributes
for(var i:Number = 0; i < names.length(); i++)
{
names[i].setName("match");
}
trace(xml.toXMLString());