xquery: How to check missing tags in input xml?
===

While working on mapping an xml to another(both with different schemas) using Xquery,I face this problem that the input xml "sometimes" doesnt contains a certain tags and sometimes it does. I want my xquery to check if the input exists, the output xml's corresponding tag should be created only then. Would it be mandtory to check each and every tag's input values? I want a simplified method to meet this goal.

Can anyone please suggest something over it?

Thanks and Regards,
Mansi