<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:spring="http://www.springframework.org/schema/beans"
       xmlns:mxml="http://www.mulesource.org/schema/mule/xml/2.0"
       xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
    xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
       http://www.mulesource.org/schema/mule/xml/2.0 http://www.mulesource.org/schema/mule/xml/2.0/mule-xml.xsd
       http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd">

    <vm:connector name="default"/>
    <vm:connector name="queue" queueEvents="true"/>

    <vm:endpoint name="in" address="vm://in" connector-ref="default"/>
    <vm:endpoint name="notxml" path="notxml" connector-ref="queue"/>
    <endpoint name="self" address="vm://self" connector-ref="queue"/>
    <endpoint name="other" address="vm://other" connector-ref="queue"/>

    <model name="xml filter test">

        <service name="test for xml">
            <inbound>
                <inbound-endpoint ref="in"/>
                <forwarding-router/>
            </inbound>
            <outbound>
                <filtering-router>
                    <outbound-endpoint address="vm://xml" connector-ref="default"/>
                    <mxml:is-xml-filter/>
                </filtering-router>
                <filtering-router>
                    <outbound-endpoint ref="notxml"/>
                    <not-filter>
                        <mxml:is-xml-filter/>
                    </not-filter>
                </filtering-router>
            </outbound>
        </service>

        <service name="filter xml for content">
            <inbound>
                <vm:inbound-endpoint path="xml" connector-ref="default"/>
                <forwarding-router/>
            </inbound>
            <outbound>
                <forwarding-catch-all-strategy>
                    <outbound-endpoint ref="other"/>
                </forwarding-catch-all-strategy>
                <filtering-router>
                    <outbound-endpoint ref="self"/>
                    <mxml:jxpath-filter pattern="/mule:mule/mule:model/mule:service[2]/@name"
                                        expectedValue="filter xml for content">
                        <mxml:namespace prefix="spring" uri="http://www.springframework.org/schema/beans"/>
                        <mxml:namespace prefix="mule" uri="http://www.mulesource.org/schema/mule/core/2.0"/>
                    </mxml:jxpath-filter>
                </filtering-router>
            </outbound>
        </service>

    </model>

</mule>
