I am trying to create a Member Eligibility Edi File (834). I need to know how to remove the segments if all the segment elements are empty.
You should provide only NULL as input for the segments you don't want included. You should set minOccurs = "0" on the segment element and then try to generate a file.