XML - Update element value with specific attribute name


I’m using XML files and I’d like to update value in Element with specific Attribute name and Attribute value


I’d like to update value ‘bbb’ with e.g. ‘ccc’
I know how to read it using xpath, but I’m struggling with updating this value. Could you help me?
Thanks in advance!

If you have the value as a String you can use String.Replace to swap “ccc” for “bbb” and then write back to the file.

filetext = filetext.Replace(“bbb”,“ccc”)

Will turn all instances of “bbb” to “ccc”. If you need to be more specific you can include the field name in the replace statement.

@DanielMitchell, thanks for your reply.
This is not what I mean actually.

I’m looking fot the way of creating path like:
//Table/TableRow/Field/@Name=“ACC”/ and write the value to this field.

Best regards,

" //Table/TableRow/Field/@Name=“ACC”/" is it working ???