Hi,
There is an xpath expression on the XML Metadata that allows to perfom that, called 'toXsd':
You can use it directly from the Metadata like in the screenshot, by clicking on the xpath expression.
This will generate it in the 'Console' View:
Or you can indeed use it in your Processes like usual xpath expressions.
This offers the possibility to make manipulation on it, load it directly in a file, ...
Here is a very simple example:
Then, when the Process is prepared, this will generate the xpath expression.
We can see it in the Step Detail View:
Is this corresponding to what you want to perform ?