xquery version "1.0";

<references>
{
    for $art in
        doc("catalog.xml")
        //article
        
    for $per in
        doc("directory.xml")
        //person
        
    let 
        $addr := $per/email
        
    where
        $art/author = $per/name
        
    order by
        $art/title
        
    return
        <article>
        { 
            ($art/title, $art/author, $addr )
        }        
        </article>
}
</references>