... is there a case for also passing linkURL through the escape_xml function...
Yes, absolutely. The <div></div> needs to be replaced (so clean_url is required) but passing the linkURL through escape_xml is a more robust solution (although if the linkURL contains any characters that need to be escaped, then this would likely point towards a badly formed link and escaping, whilst preserving the validity of the XML syntax, would hide the bad link).
As you point out, the <div></div> is not removed from the title or caption as, not only is this safe (as the title and caption are both enclosed within CDATA), but an empty <div> has exactly the same visual output in the gallery as an empty string (so there's really no need for removal here).
Incidentally, I found that Lightroom now enters "untitled" elsewhere (I can't actually remember where right now) instead of an empty string so I included this in the function so that it could be used elsewhere in the code if necessary to deal with all empty instances (although, admittedly, the name of the function should probably be renamed to be more general than just a URL cleaner).
I just wanted to get a quick fix out there for anyone using the Juicebox Plugin for Lightroom.
Some refinement might be required for a new release but, as long as the linkURL contains a valid link, there should be no problem with the file I posted above.
Thank you for your input. It's very much appreciated.