title: Using an XML element value in an XSLT predicate
body: <p>Im not entirely sure if this is possible with XSLT and my lecturer had no idea what i was talking about so if anyone could help, thanks!!!</p>
  
  <p>I have an XML file with a list of authors, each with a unique id, and a list of books, each with a child element with an IDREF as its value. The file is laid out like this:</p>
  
  <pre><code>&lt;library&gt;
    &lt;authors&gt;
      &lt;author id="a001"&gt;
         &lt;name&gt;Joyce&lt;/name&gt;
      &lt;/author&gt;
    &lt;/authors&gt;
    &lt;books&gt;
      &lt;book id="b001"&gt;
        &lt;name&gt;Illiad&lt;/name&gt;
        &lt;authorID&gt;a001&lt;/authorID&gt;
      &lt;/book&gt;
    &lt;/books&gt;
  &lt;/library&gt;
  </code></pre>
  
  <p>I am trying to write out a list of all books and, by using the authorID value, get information on the Author.</p>
  
  <p>XSLT:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p>
  
  </p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
      &lt;title&gt;XSLT Test&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;xsl:for-each select="//book"&gt;
       &lt;div style="display:block; background-color:#999; padding:2px; margin:2px;"&gt;
           &lt;h2&gt;&lt;xsl:value-of select="name"/&gt;&lt;/h2&gt;
              &lt;p&gt;&lt;xsl:value-of select="synopsis"/&gt;&lt;/p&gt;
              &lt;ul&gt;
               &lt;li&gt;Author: &lt;xsl:value-of select="//author[@id='X']/name"/&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/xsl:for-each&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>By replacing X with a value, eg a001, I can get Joyce back but how can i use the authorID value here instead, so that the system scales up nicely?</p>