Consider the following source code,
<
Get Text will return content of the first element that matches the locator. When using XPATH you can specify the index of the element you want to get, like this:
${name1} Get Text xpath=//div[@id='groupContainer']//li[@class='contactNameItemContainer'][0]//span
${name2} Get Text xpath=//div[@id='groupContainer']//li[@class='contactNameItemContainer'][1]//span
@{names} Create List ${name1} ${name2}