Refs: https://codeberg.org/forgejo/forgejo/pulls/2222
(cherry picked from commit 5f837efc15)
fix: write xml header
(cherry picked from commit a715984a42)
fix: optional elements and xml schema
(cherry picked from commit 6ea6895a36)
fix: pass all other requests to file search
(cherry picked from commit 9bfc74833a)
test: add integration test
(cherry picked from commit b798f4ce86)
fix: use xmlResponse
(cherry picked from commit 7f76df0b24)
(cherry picked from commit e18d574ca4)