How to sweep a Bitcoin Core wallet?
With recent versions of bitcoind, you can use sendtoaddress with the optional subtractfeefromamount argument.  

sendtoaddress 123abc... 1.055 "" "" true


Creates a transaction with 1.055 BTC of inputs.  The destination address will receive a little less than 1.055 BTC, after an appropriate fee is subtracted.