Populate nillable in XML

on right hand side is the output from XML formatter. I want to populate xsi:nil=‘true’ if there is no content for an element(right hand side). how to achieve this ?

able to populate xsi:nil=true using XLST.