<?xml-stylesheethref="../xsl/default.xsl" type="text/xsl"?>
-<program>
-<o:function name="ex:replace">
 <o:param name="input" type="String"/>
 <o:param name="from" type="String"/>
 <o:param name="to" type="String"/>
-<o:do>
 <o:variable name="result"/>
-<o:while test="contains($input, $from)">
 <o:set result="concat($result, substring-before($input, $from), $to)"/>
 <o:set input="substring-after($input, $from)"/>
 </o:while>
 <o:return select="concat($result, $input)"/>
 </o:do>
 </o:function>
 <o:eval select="ex:replace('There is no place like home.', 'home', 'space')"/>
 </program>