Handle errors when sending forms
Replace document if got a whole xml