final String[] queryNames = dataFactory.getQueryNames();
for (int i = 0; i < queryNames.length; i++)
{
final String queryName = queryNames[i];
final CdaQueryEntry query = dataFactory.getQueryEntry(queryName);
final AttributeList queryAttr = new AttributeList();
queryAttr.setAttribute(CdaModule.NAMESPACE, "query", query.getId());
queryAttr.setAttribute(CdaModule.NAMESPACE, "name", query.getName());
xmlWriter.writeTag(CdaModule.NAMESPACE, "query", queryAttr, XmlWriterSupport.OPEN);
final ParameterMapping[] parameterMappings = query.getParameters();
for (int j = 0; j < parameterMappings.length; j++)
{
final ParameterMapping parameterMapping = parameterMappings[j];
final AttributeList paramAttr = new AttributeList();
paramAttr.setAttribute(CdaModule.NAMESPACE, "datarow-name", parameterMapping.getName());