I have multiple xhtml files that I want to access with the document() function. Each xhtml file has multiple <p> elements with a numeric id attribute <p id="1">. I want to match this id number with a <paragraph> element of the xml file that the xslt is applied on, using the key()function. My xlst opens all the xhtml files but only matches the <p> with the <paragraph> for the fist xhtml the remaining xhtml files are not match. How can I match elements when the document() function opens multiple xhtml files?