The tWriteXMLField will produce an XML document for each input row. For example, an input row (firstName=Carl, lastName=Walker) could produce a document like <rootTag> <contact> <firstName>Carl</firstName> <lastName>Walker</lastName> <contact> <rootTag>. However, you may want to combine several of these "contacts" under one document.
See this post for a basic usage of tWriteXMLField: tWriteXMLField Component in Talend Open Studio.
This job starts with a tJava that creates a Document that will be used in the row-oriented processing of the second subjob which contains a tWriteXMLField. The second subject is driven from a tFixedFlowInput, but this could be any input source available to Talend. Finally, the document as a whole is outputted to System.out.
|Job Appending tWriteXMLField Results to a Global Doc|
|Create a Document Object and add a Root Element|
|Input for Job|
|Appending Row XML Subtree to Global Document|
|Output the XML|
|Results of Running the Job|