Question: how to get xpub key?
Answer: Open Electrum Wallet > go to wallet menu > information > the Master Public Key (MPK) you find here is the xPub key.