Solved this using the built-in event handlers. I have the following as a RequestFilter.filterRequest. It seems to do the job.
import com.eviware.soapui.support.xml.XmlUtils
def request = context.expand( '${Request#Request}' )
def parsedXml = new XmlParser().parseText(request)
def writer = new StringWriter()
new XmlNodePrinter(new PrintWriter(writer)).print(parsedXml)
def result = writer.toString()
result = XmlUtils.prettyPrintXml(result)
result = result.replaceAll( "<(.+)>---null---", "")
result = XmlUtils.prettyPrintXml(result)
context.requestContent = result