IIRC if you bribe the army in the castle then there is no damage to the buildings (except religious). Take 6 emmisaries and bribe each army 2 or 3 times. I don't know if you can stop the looting in battles except maybe attack, and then bribe the remnants (make sure some escape to hide in the fortress).

mfberg