Combined some CSJS from this stackoverflow answer (https://stackoverflow.com/a/10031076) with a remote service SSJS call, and came up with the below, which I think does what you want. But as Frantisek said, using Java beans may be a better solution.
The XPage below has a simple repeat on it, displaying 3 inputs with different values. Clicking the "Master Save" button will pull out the values of all the input textboxes in the repeat using CSJS, then makes a call to a jsonRpcService to run the SSJS that creates the documents. I added lines to pump the input values into the saved documents as well, as an example.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">
<xp:repeat id="repeat1" rows="30" var="rowData" indexVar="rowIndex">
<xp:this.value><![CDATA[#{javascript:["1","2","3"]}]]></xp:this.value>
<xp:inputText id="Number" defaultValue="#{javascript:rowData}" />
</xp:repeat>
<xp:br />
<xp:button id="masterSave3" value="Master Save">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script><![CDATA[
var domEl = dojo.byId('#{id:repeat1}');
//Get array of input textboxes
var textBoxes = domEl.getElementsByTagName("input");
//Pull out values of the textBoxes
var valueList = [];
for(var i = 0; i < textBoxes.length; i++) {
valueList[i] = textBoxes[i].value;
}
//Call the remote service that runs SSJS, passing in array of values
var deferred = masterSaveSvc.saveMethod(valueList);
deferred.addCallback(function(result) {
//Optional, display an alert upon completion, or perform some other code
alert(result);
});
]]>
</xp:this.script>
</xp:eventHandler>
</xp:button>
<xe:jsonRpcService id="jsonRpcService1" serviceName="masterSaveSvc">
<xe:this.methods>
<xe:remoteMethod name="saveMethod">
<xe:this.arguments>
<xe:remoteMethodArg name="valueList"></xe:remoteMethodArg>
</xe:this.arguments>
<xe:this.script><![CDATA[
//For each entry in the array
for(var i = 0; i < valueList.length; i++) {
//Create new document
var doc = database.createDocument();
doc.appendItemValue("Form", "PersonDoc");
//Add current value to the document
doc.appendItemValue("Name", valueList[i]);
doc.save();
//Create another new document
var doc2 = database.createDocument();
doc2.appendItemValue("Form", "PlaceDoc");
//Add current value to the document
doc2.appendItemValue("Place", valueList[i]);
doc2.save();
//Print values to the server console
println("value " + (i+1) + ": " + valueList[i]);
}
return "finished";
]]>
</xe:this.script>
</xe:remoteMethod>
</xe:this.methods>
</xe:jsonRpcService>
</xp:view>