Below is the example,
I have just replace the content of
orbeon\WebContent\WEB-INF\resources\apps\xforms-espresso\espresso-order.xhtml file with,
<html xmlns="
http://www.w3.org/1999/xhtml" xmlns:ev="
http://www.w3.org/2001/xml-events"
xmlns:xf="
http://www.w3.org/2002/xforms" xmlns:xi="
http://www.w3.org/2001/XInclude" xmlns:xxf="
http://orbeon.org/oxf/xml/xforms" xmlns:xxi="
http://orbeon.org/oxf/xml/xinclude"> <head>
<style type="text/css">
h1 {font-size: 12pt }
xf|input.itemClass { width:100px }
xf|input.custNumClass { width:100px }
xf|input.dateClass { width:80px }
</style> <title>Enter Order(s)</title>
<xf:model id="model1">
<xf:instance id="mdl">
<orders xmlns="">
<order itemNum="">
<quantity>1</quantity>
<custNum/>
<orderDate/>
</order>
</orders>
</xf:instance>
<xi:include href="oxf:/sample.xml"/>
</xf:model>
</head>
<body>
Enter Order(s)
<p>Enter data for orders below.</p>
<xf:group>
<xf:input ref="instance('mdl')/order/quantity">
<xf:label>Quantity</xf:label>
<xf:alert>This should be one</xf:alert>
</xf:input>
</xf:group>
<p>Click "Save" to store entered orders.</p>
</body>
</html>
And i have placed the sample.xml under resources folder "orbeon\WebContent\WEB-INF\resources"
<root xmlns="
http://www.w3.org/1999/xhtml" xmlns:ev="
http://www.w3.org/2001/xml-events"
xmlns:xf="
http://www.w3.org/2002/xforms" xmlns:xi="
http://www.w3.org/2001/XInclude" xmlns:xxf="
http://orbeon.org/oxf/xml/xforms" xmlns:xxi="
http://orbeon.org/oxf/xml/xinclude"><xf:bind ref="instance('mdl')/order/quantity" constraint="number(.) eq 1"></xf:bind>
</root>
Note: The same setup works, if i just have the UI code inside the sample.xml and XInclude it.