xml: T6319: add util for ancestor owner/priority
(cherry picked from commit 2551a741af9ac4f7dfff8dc5cbe47173a99fa478)