In 3.1.1 (and probably in 2.5) you can set a property on the domain-2-xml mapping to accept parameters.
And the result of the web service call can use a microflow to determine an object, so when having 2 system-filedocuments in your mapping that are related and inputting the object it needs to relate to you can write a small microflow that returns this inputted object to the result message to link to it.
This must sound vague... if you have questions let me know.