You should be receiving encoded XML in TN, if this is not an option you can always create a gateway service and encode the XML yourself before sending it to TN.
An XML document with an unencoded & in the data is not valid XML. This should be corrected at the source.
A gateway service that tries to fix this error is not a good option. Replacing all & with another character or with & will break properly encoded entities. The right approach is to get the system that is creating the XML to do so correctly.
You didn’t mention whether IS is posting to TN or some other client is posting. FYI, When I got the similar error I followed the below approach (from IS to TN):
Thank you so much for your responses.
“This should be corrected at the source itself.” But the issue here is that we are receiving the xml from a different application which needs an enhancement to do this change which is time consuming and also costs money.