XML DML is very flexible and most scenarios can be dealt with quite nicely with the use of the modify() function.
We can however only use the modify() function as part of an UPDATE or SET statement.
This example will insert a new attribute called Has Registered into the top level node.
Finally another feature within the DML is the ability to use conditional statements, namely if...
The curly braces ensure that whatever is in the braces is computed first and the result of that computation is passed up.