Function getTextFromElements

retrieves text from text elements and concatenates to a single string