To get started create a sample xml document and xml record with the correct structure to comply with your schema. FME has no way of auto-generating this from your xml schema (xsd). There are tools out there that will do this such as XML Spy. You can give it an xsd and it will generate a sample xml document with some random data that is an xml data instance of this xsd. You can then use this to form the basis of your xml template.
If your xsd is very simple you could do this manually. However, if yours has enough nesting and inheritances, to do this manually would likely involve a lot of work and trial and error. The other option is that if you can find some sample data that already complies with your schema, and use this as a basis to create a template by extracting the document structure and the record structures from it.
For the simplest case, if you had an employee table with name and position columns in it, the xml data for 2 records might look like:
<?xml version="1.0" encoding="UTF-8"?>
<Feature Collection>
<employee>
<name>John</name>
<position>Reception</position>
</employee>
<employee>
<name>Susan</name>
<position>Boss</position>
</employee>
</Feature Collection>
There would generally be 2 xml templates to generate this, one which would be a prototype for the document, and one as a record prototype. So this might look like:
datasetTemplate.xml:
<?xml version="1.0"?>
<Feature Collection>
fme:get-xml-list-attribute("_list{}.features")
</Feature Collection>
and featureTemplate.xml
<employee>
<name>fme:get-attribute("employee_name")</name>
<position>fme:get-attribute("employee_position")</position>
</employee>
Where employee_name and employee_position are the names of the attributes on the features within the workspace that calls the XMLTemplater transformer and passes it this template. The employee features would first pass through the XMLTemplater_Features and then you could use a ListBuilder to aggregate all the xml features together before passing them to the XMLTemplater_Dataset transformer which would apply the dataset template.
The point is, the structure around employee and the name / position fields can be as complex as needed to satisfy the schema. All FME cares about is where the data values go.
However, to do this you still need a sample record and sample document. If you dont have this, either you will need to generate it from a third party program. Note that we do have new transformers for XML Validation against a specific xml schema / xsd. We strongly recommend downloading the latest FME 2011 beta when working with XML as there have been a lot of improvements since 2010 that will help a lot.
For more on Xml Spy see:
http://www.altova.com/xmlspy/xml-schema-editor.html
near the bottom is the paragraph:
"You can also automatically generate an XML Schema or DTD from use cases, and inversely, you can auto-generate sample XML instance documents from your XML Schema/DTD to test its functionality. The graphical XML Schema editor even allows you to create sample values for XML instance generation so that they will contain arbitrary results, selected from pre-supplied values. You can choose to have this data can populate your sample instance randomly, by cycling through, or by using only the first entry in the list."
For a complete example of how to create XML from an input CSV table see:
http://www.fmepedia.com/index.php/XMLTemplater_Examples