This is actually missing some more of the filters applied in OdfUtils. I suspect it will return some unexpected text in flat ODTs (e.g., base64 binary of any embedded images in the selection), along with other suprising text content.

Other key checks required from OdfUtils are isAcceptedNode & isGroupingElement. See OdfUtils.getTextElements for the "expected" (maybe?) list of things that make up the selection body.