
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:oxf="http://www.orbeon.com/oxf/processors"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output"/>

    <p:processor name="oxf:xslt">
        <p:input name="data" href="clientes.xml"/>
        <p:input name="instance" href="#instance"/>
        <p:input name="config">
            <clientes xsl:version="2.0">
                <xsl:choose>
                    <xsl:when test="doc('input:instance')/*/@xsi:nil = 'true'">
                        <!-- Initially just take the first 10 clientes -->
                        <xsl:copy-of select="/clientes/cliente[10 >= position()]"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:copy-of select="/clientes/cliente[starts-with(lower-case(name),
                            lower-case(doc('input:instance')/instance/cliente-name))][10 >= position()]"/>
                    </xsl:otherwise>
                </xsl:choose>
            </clientes>
        </p:input>
        <p:output name="data" ref="data"/>
    </p:processor>

</p:config>
