Publishing failure due to nbsp

I am having my first experience of this well documented transform exception
the entity nbsp was referenced by not declared xslt processing.

I have read the main advice online which appears to be

1. Replace   with  
2. Declare the Entity e.g. <?xml version="1.0"?><!DOCTYPE some_name [<!ENTITY nbsp "&#160;">]>

I wonder if it is possible to implement option 1 during pre-processing for all instances of nbsp found in the content and if so can anyone advise how I might tackle this?
Any advice appreciated,