let $docXQuery :=document("http://www.w3.org/TR/2001/WD-xquery-20010215/") return <toc>filter($docXQuery, $docXQuery//h1 | $docXQuery//h2 </toc>