All the input/output/port stuff in XProc seemed incomprehensible to me until I recognized something simple. Every time you see a <pipe> element, read it as “comes from”. For example
<p:output port="result"> <p:pipe step="validated" port="result"/> </p:output>reads as ‘output to the “result” port comes from the port “result” on step “validated”‘ and
<p:input port="source"> <p:pipe step="included" port="result"/> </p:input>reads as ‘input for the “source” port comes from the port “result” on step “included”‘. If you keep this in mind it all makes much more sense.
More collected Geek Thoughts at http://geekthoughts.info.