How can I retrieve XML metadata with DataCite APIs?

There are two ways to retrieve XML metadata using DataCite APIs.

The OAI-PMH Service :

This DataCite service exposes metadata stored in the DataCite Metadata Store (MDS) using the Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH). You can retrieve records via OAI-PMH in several formats, including 1) the OAI DataCite (oai_datacite) metadata format which was established for the dissemination of DataCite records using OAI-PMH and 2) the DataCite Direct (datacite) format, which contains only the original DataCite metadata without additions or alterations.

The DataCite REST API:

When retrieving a list of DOIs, the REST API supports several parameters that can be used to refine, sort, and change the presentation of the results. You can use additional parameters to control the results returned by the DataCite REST API. To retrieve the XML version of the metadata in your REST API response, include the &detail=true parameter in your requests:

https://api.datacite.org/dois?client-id=datacite.datacite&detail=true

With &detail=true, each result will contain a base64-encoded XML version of the metadata in the xml attribute.