Your question is related more so to a programming fundamental in most languages, than to the ESO API. That is: to capture the return value of any function it is typical to assign it to a variable. Lua is no different in this regard.
Something like:
Code:
local num = math.random(100)
...would suffice to assign the return value of math.random() to the variable num, however once stored in a variable it then needs to be returned from the LootDiceRoll() function you've made.
... and finally, inserted into the game UI.
Code:
Roll = LootDiceRoll()
YourXMLElement:SetText( Roll )
Good Luck!