How to return from synchronous callback?

I am using a library (xml2js‘s parseString) that, for backward compatibility reasons, uses a callback on a synchronous function (it used to be async, so the callback made sense, but now it is sync).

Here is my solution right now that works, but I’m not sure if it is the best way:

function getBookTitle(bookXml) {
    let res;
    parseString(bookXml, function(err, json) {
        res = json.title;
    });
    return res;
});

parseString is synchournous, so this works.

I already read How do I return from synchronous callback? but the answer changes the original function so it is useless for my case.