We're dealing with a legacy system whose XML output is not defined against a schema and not optimal, so we're actually defining our own, nicer schema and applying XSL transforms to the received XML to make it match.
One special case in the received XML is "oh, if this field has a special 'magic value' it means something different to normal. So we want to add a rule. e.g. given:
<SomeObject>
<Id>123</123>
<UpdateCount>-1</UpdateCount>
</SomeObject>
Output:
<SomeObject>
<Id>123</123>
<UpdateCount xsi:nil='true'/> //we don't HAVE to have this but it's preferred
<Deleted>true</Deleted>
</SomeObject>
Ideally, for all other values of UpdateCount we would add <Deleted>false</Deleted> but again this isn't a requirement, we can make this property optional it just makes things slightly more messy.
You could do:
Or: