# XML functions

This page describes the additional set of predefined Jsonnet functions for the [Data Transformer Script](https://docs.cloud.google.com/application-integration/docs/configure-data-transformer-script-task.md.txt) task available in Application Integration.

### Before you begin


To use the following predefined functions, you must import the `functions` library in your script. Importing the `functions` library lets you use both the standard Jsonnet functions and the predefined **Data Transformer** functions.


Application Integration supports Jsonnet functions library v0.20.0. For information about the Jsonnet standard functions, see [Jsonnet Standard Library](https://jsonnet.org/ref/stdlib.html).

### `Parse XML`

| Syntax | ```html parseXml(xml, format = "badgerfish") ``` |
| Description | Parses the specified input XML string into a JSON object. |
| Input parameter | **xml:** The input XML string. **format:** The output JSON representation format. > [!NOTE] > **Note:** The default JSON representation format used is [BadgerFish](http://www.sklar.com/badgerfish/). The **parseXml()** function currently only supports *BadgerFish* format. <br /> |
| Return type | `JSON` |
| Output | Returns the JSON object representation of the provided XML string. |
|---|---|

*** ** * ** ***

### `Manifest XML`

| Syntax | ```html manifestXml(json, format = "FORMAT", indent_output = false) ``` |
| Description | Converts the specified input JSON object into an XML string. |
| Input parameter | **json:** The input JSON object. **format:** The input JSON representation format. Replace <var translate="no">FORMAT</var> with one of the following supported formats: - `badgerfish` (default): Use the [BadgerFish](http://www.sklar.com/badgerfish) format to map JSON fields to XML in a key-value manner. - `jsonml`: Use the [JsonML](https://en.wikipedia.org/wiki/JsonML) format when maintaining element order is important for your integration, as it represents XML elements as arrays and preserves their original ordering. **Example usage:** ```html manifestXml(jsonObject, "badgerfish", false) [or] manifestXml(jsonArray, "jsonml", false) ``` **indent_output:** Boolean input to indicate if the output XML string should be indented. Default value is `False`. |
| Return type | `STRING` |
| Output | Returns the XML string of the provided JSON object representation. |
|---|---|

*** ** * ** ***

### `XSL Transform`

| Syntax | ```html xslTransform(xml, xsl, params = {}) ``` |
| Description | Transform the specified XML string using the specified XSL string and the specified parameters. > [!NOTE] > **Note:** XSL version 1.0 is supported. |
| Input parameter | **xml:** The input XML string. **xsl:** The input XSL string. **params:** The input parameters that are passed to the XSL transformation. - The parameters are passed as a JSON object with *keys* representing the parameter name and *values* representing the parameter value. - The parameter values can be of type `STRING`, `INTEGER` or `BOOLEAN`. **Example usage:** ```html { "param1": "value1", "param2": 123, "param3": true } ``` <br /> |
| Return type | `STRING` |
| Output | Returns the output of the XSL transformation performed on XML using XSL. |
|---|---|

## Recommendation

- Learn how to add and configure a [Data Transformer Script task](https://docs.cloud.google.com/application-integration/docs/configure-data-transformer-script-task.md.txt)