Accessing XCUIElements if you do not know their name/id

Hello I am using Appium in Java to interact with a browser based video player on mobile Safari for iOS devices. To run my tests, I am having the video player display the JavaScript DOM test results on the web page. I am using Appium to load the page and click the play button to start the test. I am hoping to be able to pull the test results into my Java test suite and parse them. An example of a test result is this, 00:00:00.775: Got test result: “pass”, message: “Got event ‘OnMediaPlaying’ in 250ms (timeout was 30000ms).”. The issue that I am running into is that the DOM is wrapped in an XCUIElementTypeStaticText and is given a name and accessibility id that is the message itself, making it so I cannot retrieve it. Is there some way that I can access it by its original JavaScript class/DOM name? I have tried driver.getElementsByClassName and that did not seem to work. Thank you in advance!