I assumed the criteria is static.I tried the dynamic approach. Let’s see if this works for you
You have to place the fields inside a wrapper document so documentToXMLString assigns the attribute properly.

if you cannot use documentTypeName then we have to go for the java service to create a wrapper document
pub.xml:xmlNodeToDocument
Jave service to create a wrapper.
Java service
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
// document
IData document = IDataUtil.getIData( pipelineCursor, "document" );
String name = IDataUtil.getString( pipelineCursor, "name" );
pipelineCursor.destroy();
IData output = IDataFactory.create();
IDataCursor outputCursor = output.getCursor();
IDataUtil.put(outputCursor, name, document );
outputCursor.destroy();
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, "output", output );
pipelineCursor_1.destroy();
output has a wrapper document with the name of the name passed as input
#webMethods#Integration-Server-and-ESB#Service-Designer