I have a XML feed from a web app (over which I have control as to how the XML is tagged etc) and the XML drops into an indd template, applies character, para, table and cell styles.

The issue I have is that if an XML tag is empty (and they often are), I can't search and replace for extra carriage returns as there's markers in there from the XML (I believe, correct me if I'm wrong).

If I select the invisible characters and paste them into the Find and Replace dialogue box, they show up as ~I (GREP) or ^I (normal), which is apparently an index marker.

Is there any way of getting rid of these via a script? If I try to search for those invisible characters, no changes get made, i.e. none are found.