title: Traverse on node XSLT
body: <p>I am not very familiar with xslt. I am trying to traverse through a node to print questions and i have the answers in a seperate node. I need to find the anwers after matching with the question id</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="test.xsl"?&gt;
  &lt;details&gt;
   &lt;detail&gt;
    &lt;answersall&gt;
      &lt;answers&gt;
          &lt;question id="1"/&gt;
          &lt;answer&gt;4&lt;/answer&gt;
          &lt;note&gt;test&lt;/note&gt;
      &lt;/answers&gt;
      &lt;answers&gt;
          &lt;question id="2"/&gt;
          &lt;answer&gt;2&lt;/answer&gt;
      &lt;/answers&gt;
     &lt;/answersall&gt;
    &lt;detail&gt;
    &lt;questions&gt;
     &lt;question id="1" text="Hello how are you" section="a"/&gt;
     &lt;question id="2" text="how was your day" section="a"/&gt;
   &lt;questions&gt;
  &lt;details&gt;
  </code></pre>
  
  <p>I am trying to print something like this<br>
  <code>Question                  Answer</code><br>
  <code>Hello How are you          4</code><br>
  <code>How was you day            2</code><br>
  i was able to print the questions using XSL for-each, but i am not sure how i can find the answer. 
  I must be able to match the question id and then go to the next node and find the answer and print it.</p>
  
  <p>So far this all i have got with xsl</p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
     &lt;xsl:template match="/"&gt;
      &lt;html&gt;
        &lt;body&gt;
          &lt;h2&gt;&lt;center&gt;Details&lt;/center&gt;&lt;/h2&gt;
           &lt;table&gt;
               &lt;xsl:for-each select="details/questions/question[@section='a']"&gt;
                   &lt;tr&gt;
                      &lt;td&gt;&lt;xsl:value-of select="@text"/&gt;&lt;/td&gt;
                      &lt;td&gt;????&lt;/td&gt;
                   &lt;/tr&gt;
               &lt;/xsl:for-each&gt;
           &lt;/table&gt;
        &lt;/body&gt;
      &lt;/html&gt;
     &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>