Sample XML i posted below.

<blockTO>
<GroupId xsi:nill="true"/>
<AF>DN</AF>
<AC>UU</AC>
<Name>Karthik</Name>
</blockTO>

1. if the groupId is null the element should be removed
2. if AF is DN then change AC to AU