The task is to get the text using XPATH. XPath is a locator used to locate an element using the XML path. XPath stores the key-value pair similar to HTML tags.
So, inorder to find the Text all you need to do is:
driver.findElement(By.xpath("//*[contains(text(),'the text you are searching for')]"));
This way you can find the text you are looking for.
Hope this helps @Jino