# Exporta table to XLM

**URL:** <https://forum.inductiveautomation.com/t/exporta-table-to-xlm/34762>\
**Category:** Ignition\
**Created:** [May 14, 2020, 7:59pm UTC](https://forum.inductiveautomation.com/t/exporta-table-to-xlm/34762 "2020-05-14T19:59:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mavallejo](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mavallejo](https://forum.inductiveautomation.com/u/mavallejo)\
**Post date:** [May 14, 2020, 7:59pm UTC](https://forum.inductiveautomation.com/t/exporta-table-to-xlm/34762/1 "2020-05-14T19:59:12Z")

</div>

Hello everyone, someone can help me to know, how I can print dataset from table to XML format?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 15, 2020, 6:29pm UTC](https://forum.inductiveautomation.com/t/exporta-table-to-xlm/34762/2 "2020-05-15T18:29:52Z")

</div>

XML is pretty wide open, but a simple XML output:

```python
import xml.etree.ElementTree as ET

dataIn = system.dataset.toPyDataSet(event.source.parent.getComponent('Power Table').data)

headers = list(dataIn.getUnderlyingDataset().getColumnNames())

tree = ET.Element('dataset')
comment = ET.Comment('Dataset to XML Test') 
tree.append(comment)

for row in dataIn:
	rowElement = ET.SubElement(tree, 'row')
	for col in headers:
		colElement = ET.SubElement(rowElement, col)
		colElement.text = str(row[col])

xmlString = ET.tostring(tree)

print xmlString
```
