Hi,
you can achieve this using text equals funciton.
i am not using exist as it always comes in xml input.
else you can use mapWithDefault node function.
if the tag appears you with values it passes the same.
if there is no tag then it passes the constant value.
for empty tag concept you can follow below link
http://stackoverflow.com/questions/7238254/xml-what-is-this-null-or-empty-element
correct me if i did not get your requirement.
Regards,
Muniyappan.