It wouldn't entirely eliminate the hum, but a balanced feed (note that XLR can be unbalanced as well) will reduce the EM interference and cross talk that adds to the background hum.
Another contributing factor is when power supplies to the equipment are different or "dirty". Often this can be resolved with something as simple as a multi-adapter with the earth pin disconnected (note, this shouldn't be attempted unless your hardware is already insulated. but then if you're trying to commit a crime, then an electric shock is likely preferable to life sentences in jail).