# tWriteXMLFields properties for Apache Spark Structured Streaming

[Preview](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Introduction/feature-preview-program-overview.htm)

Use these properties to configure tWriteXMLFields running in the Spark Structured Streaming Job framework.

The Spark Structured Streaming tWriteXMLFields component belongs to the Processing family.

The streaming version of this component is available in Talend Real-Time Big Data Platform and in Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Output column | Select the schema column that will hold the serialized XML<br>string. |
| Configure XML Tree | Click ... to open the XML mapping editor, where<br>you define the XML structure by mapping input columns to XML paths. The editor<br>supports three mapping sections:<br><br><ul> <li><span>Root</span>: defines the top-level XML structure and                        maps input columns to root-level elements or attributes.</li> <li><span>Group</span>: defines intermediate grouping elements in                        the XML structure.</li> <li><span>Loop</span>: defines the repeated elements serialized                        once per grouped row.</li> </ul> |
| Schema and Edit schema | A schema is a row description. It defines the fields (columns) processed by the<br>component. When you create a Spark Job, avoid the reserved word<br>line when naming fields.<br><br><ul> <li><p><span>Built-In</span>: create and store the schema locally for                        this component only.</p></li> <li><p><span>Repository</span>: reuse a schema created and stored in                        the Repository across projects and Job designs.</p></li> </ul><br><br>Click Edit schema to modify the schema. If you modify a<br>Repository schema, the available options include:<br><br><ul> <li><p><span>View schema</span>: view the schema without modifying it.</p></li> <li><p><span>Change to built-in property</span>: change the schema to                        <span>Built-in</span> for local changes.</p></li> <li><p><span>Update repository connection</span>: modify the Repository                        schema and choose whether to propagate the changes to other Jobs.</p></li> </ul> |
| Use group by | Select this check box to group multiple input rows into a single XML<br>document. In the table that appears, add the columns used as grouping<br>keys. |
| Use data column as partition key | Select this check box to use a data column as the partition key when<br>writing to a downstream component such as<br>tKinesisOutput. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Create empty element if needed | Select this check box to include empty XML elements in the output when an<br>input column has no value. This check box is selected by default. |
| Encoding | Select the character encoding for the XML output from the drop-down<br>list. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is used as an intermediate step.<br><br>This component, along with the Spark Structured Streaming component Palette it belongs to,<br>appears only when you are creating a Spark Structured Streaming Job. |
| Spark Connection | You need to use the Structured Streaming Configuration<br>tab in the Run view to define the connection to a Spark cluster for<br>the whole Job.<br><br>This connection is effective on a per-Job basis. |