In other words, I have to search for param element with name attribute = "id" (something like that: //*[local-name()='param'][@name='id']) remove it and then:
1) or leave the same value ("default")
2) or update it with a new one ("NewValue")
Please, consider that all elements name could change. Only "param" will be a constant.
modify (
for $id in $input//Id
let $param := $id/param[@name="id"]
where $param
return
if (true()) then
replace value of node $id with "NewValue"
else
replace value of node $id with $param/string()
) return $input