Recovering galaxy cluster gas density profiles with XMM-Newton and chandra