RSS 1.0をパースするXQuery
 XQueryを習得した直後に作ったものです。これはこれで面白いので取っておくことにします。
declare namespace rss = "http://purl.org/rss/1.0/";
declare namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
declare namespace dc = "http://purl.org/dc/elements/1.1/";
declare namespace content = "http://purl.org/rss/1.0/modules/content/";

declare function local:cut($text as xs:string , $len as xs:integer) as xs:string{
	if(string-length($text) > $len) then 
		concat(substring($text , 0 , $len) , "...") else $text
};

<html>
<head>
<title>XQuery RSS Reader</title>
</head>
<body>

<b>XQuery RSS Reader</b><br />
<br />

{
let $blog := /rdf:RDF/rss:channel return 
	<table border="0" cellpadding="2" width="80%">
	<tr><td bgcolor="#CCDDFF" colspan="2">
	<b><a href="{$blog/rss:link/text()}">{$blog/rss:title/text()}</a></b> - 
	<small>last update : {(for $d in /rdf:RDF/rss:item/dc:date/text() order by $d descending return $d)[1]}</small>
	</td></tr>
	<tr><td width="5"></td>
	<td>

	<table border="0" cellspacing="1" width="100%">
	<tr><td>RDF {let $about := string($blog/@rdf:about) 
		return <a href="{$about}">{$about}</a>}</td></tr>
	<tr><td>URL {let $link := $blog/rss:link/text() 
		return <a href="{$link}">{$link}</a>}</td></tr>
	<tr><td>{if(string-length($blog/rss:description/text())) then local:cut($blog/rss:description/text() , 256) else ()}</td></tr>
	</table>

	{
	for $item in /rdf:RDF/rss:item[@rdf:about = $blog/rss:items/rdf:Seq/rdf:li/@rdf:resource] 
		order by $item/dc:date/text() descending return 
		(<br /> , <table border="0" cellpadding="2" width="100%">
		<tr><td bgcolor="#CCDDFF" colspan="2">
		<a href="{$item/rss:link/text()}">{$item/rss:title/text()}</a> - 
		<small>{$item/dc:date/text()}</small></td></tr>
		<tr><td width="5"></td><td>{if(string-length($item/rss:description/text())) then local:cut($item/rss:description/text() , 256) else ()}</td></tr>
		</table>)
	}

	</td></tr>
	</table>
}
</body>
</html>