---
title: c XJ
description: Available connectors
documentId: ipaas-xj
locale: en-US
---

The [**XJ**](https://camel.apache.org/components/4.10.x/xj-component.html) component allows you to convert XML and JSON documents without the need for intermediate Java objects.

**URI Syntax**: `xj:resourceUri`

## Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|------------------|------------|----------|
| `resourceUri` (producer)| (required) Path to the template. The following is supported by the default URIResolver. You can prefix with: classpath, file, http, ref or bean. | — | String |

*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|------------------|------------|----------|
|`transformDirection` (producer) | (required) Transformation direction. Can be XML2JSON or JSON2XML. | — | TransformDirection |

## Example

<Steps>
<Step>
The flow receives a POST request.
</Step>
<Step>
Then, converts JSON data to XML using the XJ component (`transformDirection: JSON2XML`).
</Step>
<Step>
Finally, logs the result.
</Step>
</Steps>

```yaml
- from:
    uri: rest:post:hello
    steps:
      - to:
          uri: xj:identity
          parameters:
            transformDirection: JSON2XML
      - to:
          uri: log:INFO
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/component_xj_7c6cc3e550.png)

### cURL

```
curl --location --request POST 'https://sensedia-integration-camel-poc.f6g7h8i9j0.integrations-tst.sensedia-eng.com/hello' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstname": "camel",
    "lastname": "apache",
    "personalnumber": 42,
    "active": true,
    "ranking": 3.1415926,
    "roles": [
        "a",
        {
            "x": null
        }
    ],
    "state": {
        "needsWater": true
    }
}'

```

### Result

```
sensedia-integration-camel-poc-00001-deployment-55bdddc7b85p25g integration 2024-03-07 13:19:09,706 INFO  [info] (executor-thread-1) Exchange[ExchangePattern: InOut, BodyType: String, Body: <?xml version="1.0" encoding="UTF-8"?><object xmlns:xj="http://camel.apache.org/component/xj" xj:type="object"><object xj:name="firstname" xj:type="string">camel</object><object xj:name="lastname" xj:type="string">apache</object><object xj:name="personalnumber" xj:type="int">42</object><object xj:name="active" xj:type="boolean">true</object><object xj:name="ranking" xj:type="float">3.1415926</object><object xj:name="roles" xj:type="array"><object xj:type="string">a</object><object xj:type="object"><object xj:name="x" xj:type="null">null</object></object></object><object xj:name="state" xj:type="object"><object xj:name="needsWater" xj:type="boolean">true</object></object></object>]
```
