It's usually just the flanges that are corroded, grind them off and replace with stainless versions for £24
http://www.ebay.co.uk/itm/BMW-E46-M3-Z4M-Exhaust-Flange-Repair-Rusted-Corroded-Broken-4-Flange-Kit-/171857157973?hash=item28037c1f55:g:tdsAAOSwyQtVo6nQ