socket xml saving, misc cleanup