Add the following under the project
node of your NAnt script:
<script language="c#" prefix="custom">
<code>
<![CDATA[
[Function("evaluate-xpath")]
public static string EvaluateXPath(string xpath, string info)
{
System.Xml.XPath.XPathDocument xml = new System.Xml.XPath.XPathDocument(info);
return xml.CreateNavigator().Evaluate(xpath).ToString();
}
]]>
</code>
</script>
Then you can use the following expression to achieve what you want:
if="${int::parse(custom::evaluate-xpath('count(//ActionCollection/Item)', path::combine(skinFolder 'screens.temp.xml'))) > 0}"
Just note that if your xml file has nodes that are given a namespace, then this won't work.