declare namespace rssd = "http://www.25hoursaday.com/2003/RSSBandit/feeds/"

define function getNew($new, $old){
for $currFeed in $new/rssd:feed where empty($old/rssd:feed[rssd:title=$currFeed/rssd:title])
return
<li>
<a href="{string($currFeed/rssd:link)}">{string($currFeed/rssd:title)}</a> (<a href="{replace(string($currFeed/rssd:link),"http:","feed:")}">Subscribe</a>)
</li>
}

<html><head><title>RSS Bandit Synch</title></head><body>
{
let $feeds := doc('feedlist.xml')/rssd:feeds
let $feeds2 := doc('feedlist2.xml')/rssd:feeds
let $diff1 := getNew($feeds,$feeds2)
let $diff2 := getNew($feeds2,$feeds)
return
<div> 
<b>The items below are missing from feed list 1:</b>
<ul>{$diff1}</ul>
<b>The items below are missing from feed list 2:</b>
<ul>{$diff2}</ul>
</div>
}
</body></html>