# XML Response Example

> Demonstrates returning XML responses via g.res.contentType = XML in API Maker.

Source: https://docs.apimaker.dev/v1/examples/res/contentType/XML.html

### XML

**Content type XML**

```typescript
g.res.contentType = T.EContentType.XML;
return "Hello world from the API Maker.";
```

Response
```xml
<?xml version='1.0'?>
<root>
    <success>true</success>
    <statusCode>200</statusCode>
    <data>Hello world from the API Maker.</data>
</root>
```

## Related

- [The global object g](https://docs.apimaker.dev/v1/docs/pre-defined-terms/global-object-g.html) · [Custom APIs](https://docs.apimaker.dev/v1/docs/apis-all/custom-apis/user-created-custom-api.html)
