# 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

<!-- --8<-- [start:body] -->

### XML 

```typescript title="Content type XML" linenums="1"
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>
```

<!-- --8<-- [end:body] -->

## Related

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