How do I get back XML instead of JSON?

The correct syntax is:

formatter=xml

For example:

https://api.tfl.gov.uk/Line/47/StopPoints?formatter=xml
https://api.tfl.gov.uk/StopPoint/Search?query=Elephant&maxResults=5&formatter=xml

As you mentioned, you can also do this with the HTTP Accept header e.g.:

$ curl -H "Accept: text/xml""https://api.tfl.gov.uk/Line/victoria/StopPoints"

2 Likes