Seems to work for me.
$ curl -v -o out.txt
http://192.168.1.5:9981/xmltv/channels
> GET /xmltv/channels HTTP/1.1
> Host: 192.168.1.5:9981
> User-Agent: curl/7.82.0
> Accept:
/
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: HTS/tvheadend
< Cache-Control: no-cache
< Connection: Keep-Alive
< Content-Type: text/xml
< Content-Length: 7248039
$ cat out.txt
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
<tv generator-info-name="TVHeadend-4.3-2010~g3b1d7a928-dirty" source-info-name="tvh-Tvheadend">
<channel id="7e7b77801531c803f5ce8f4d5003f44c">
<display-name>Channel 5+1</display-name>
<display-name>46</display-name>
</channel>
<channel id="954d3d83600c6caf0bffed1ee206c140">
<display-name>GREAT! Movies Action</display-name>
<display-name>42</display-name>
</channel>
<channel id="e527c684528673bcd1193c0e1651d67c">
<display-name>Dave ja vu</display-name>
<display-name>74</display-name>
</channel>
...
<programme start="20220422020000 +0100" stop="20220422040000 +0100" channel="7e7b77801531c803f5ce8f4d5003f44c">
<title>The LeoVegas Live Casino Show</title>
<desc>The LeoVegas Live Casino Show</desc>
<category lang="en">Show / Game show</category>
</programme>
<programme start="20220422040000 +0100" stop="20220422041000 +0100" channel="7e7b77801531c803f5ce8f4d5003f44c">
<title>Entertainment News on 5</title>
<desc>A daily round-up of showbiz news and gossip from around the world, focusing on celebrities, movies, music and entertainment.</desc>
<category lang="en">Show / Game show</category>
</programme>
...
</tv>
For a description of the available formats see
https://github.com/dave-p/TVH-API-docs/wiki/Other-Functions#xmltv