Hi All,I am using the tpl file for cleaning the generated xml while saving the DCT.For an item there are two attributes one is "id" and another is "script".script is checkbox whose value is "Y" and id is the text field where user enters some value.Actuall Requirement is:When script is empty and id is not empty then the item should replace withnon empty attributes.For cleaning this, I am using the tpl file in presentation.There are 3 conditions to apply:1) Both script & id are empty.2) For id ="" & script="Y" replace with only script attribute.3) For id="value" & script="" replace with only id attribute.I want solution for 3 condition.I have attached the file with sample code. Thanks in advance.