An Xpub key can be broken into 2 parts starting with the 32 bytes one which is the key and the last 32 bytes is the chaincode. You can use the key part to create addresses by hashing it with ripemd160(sha256(key)) and then encoding the resulting 20 byte hash with Base58 for legacy P2PKH addresses or Bech32 for Segwit P2WPKH addresses.