La vesione facile:

https://www.php.net/manual/en/features.http-auth.php

La versione "professionale":

https://packagist.org/packages/league/oauth2-server

Ma la vera domanda è: perchè usare XML?