May be, XSLT was quite popular at times.
Depends how old this codebase is. We still use it in older project but our common scenario was to transform XML files saved on disk, not live data retrieved from DB.
JSON wasn't widely used back then, XML was the only de-facto standard. It's CMS and basically, one XML file was one article or section page.
It has (had) some pros.
- It was faster than other solutions available in PHP world, as libxslt is written in C.
- Majority of the view code was written in XSLT and independent of PHP, so it should be easier to migrate to another stack. However that didn't happen in the end.
- Web designers meant to be able to dissect static html pages into XSLT views with mockup XML data, using 3rd party tools independent of our CMS. This turned out to be not so easy too. :)
Nowadays you have to really like XSLT way of thinking (push vs pull, etc...) to choose it.
I still prefer it to manipulate XML files, but it's usually via xsltproc CLI utility, sometime combined with a lot of grep, sed, etc...
Look at that code once more, maybe you see traces of the same motives there. :)