the structure that i used is just an example.
You dont need to make any changes in the Source structure.
Change will be on the receiver structure. That is adding the footer node with a field to store the record count......this field will be mapped with the UDF.