xa: fix build on 10.9 and add test

Fixes #25338 and adds a test.