title: XSLT on XML to CSV with column headers only on certain nodes
body: <p>I have an XML file that has information regarding a football game and its scoring plays that occurred. I would like to select only certain nodes that I am interested in and save them off to a CSV.</p>
  
  <p>I am really only interested in these nodes:</p>
  
  <ul>
  <li>/gam:game/gam:date</li>
  <li>/gam:game/gam:awayTeam/gam:Abbreviation</li>
  <li>/gam:game/gam:homeTeam/gam:Abbreviation</li>
  <li>/gam:quarterSummary/gam:quarter/gam:scoring/gam:scoringPlay/gam:teamAbbreviation</li>
  <li>/gam:quarterSummary/gam:quarter/gam:scoring/gam:scoringPlay/gam:playDescription</li>
  </ul>
  
  <p>My expectation would be something like this in the CSV (comma delimited)</p>
  
  <pre><code>GameDate, AwayTeam, HomeTeam, ScoringTeam, PlayDescription
  
  2017-01-07, DET, SEA, SEA, (7:14) R.Wilson pass short right to P.Richardson for 2 yards, TOUCHDOWN. Penalty on DET-T.Wilson, Defensive Pass Interference, declined.
  
  2017-01-07, DET, SEA, SEA, S.Hauschka extra point is GOOD, Center-T.Ott, Holder-J.Ryan.
  
  2017-01-07, DET, SEA, SEA, (2:00) S.Hauschka 43 yard field goal is GOOD, Center-T.Ott, Holder-J.Ryan.
  
  2017-01-07, DET, SEA, DET, (:25) M.Prater 51 yard field goal is GOOD, Center-D.Muhlbach, Holder-S.Martin.
  
  2017-01-07, DET, SEA, DET, (4:08) M.Prater 53 yard field goal is GOOD, Center-D.Muhlbach, Holder-S.Martin.
  
  2017-01-07, DET, SEA, SEA, (14:15) S.Hauschka 27 yard field goal is GOOD, Center-T.Ott, Holder-J.Ryan.
  
  2017-01-07, DET, SEA, SEA, (8:53) (Shotgun) T.Rawls right guard for 4 yards, TOUCHDOWN.
  
  2017-01-07, DET, SEA, SEA, (3:43) (Shotgun) R.Wilson pass short middle to D.Baldwin for 13 yards, TOUCHDOWN.
  
  2017-01-07, DET, SEA, SEA, S.Hauschka extra point is GOOD, Center-T.Ott, Holder-J.Ryan.
  </code></pre>
  
  <p>The input XML:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;gam:gameboxscore xmlns:gam="http://leaguemanager.beacontender.com/plugin/feed/sport/usftbl/gameboxscore"&gt;
      &lt;gam:lastUpdatedOn&gt;2017-01-08 12:22:22 AM&lt;/gam:lastUpdatedOn&gt;
      &lt;gam:game&gt;
          &lt;gam:date&gt;2017-01-07&lt;/gam:date&gt;
          &lt;gam:time&gt;8:15PM&lt;/gam:time&gt;
          &lt;gam:awayTeam&gt;
              &lt;gam:ID&gt;61&lt;/gam:ID&gt;
              &lt;gam:City&gt;Detroit&lt;/gam:City&gt;
              &lt;gam:Name&gt;Lions&lt;/gam:Name&gt;
              &lt;gam:Abbreviation&gt;DET&lt;/gam:Abbreviation&gt;
          &lt;/gam:awayTeam&gt;
          &lt;gam:homeTeam&gt;
              &lt;gam:ID&gt;79&lt;/gam:ID&gt;
              &lt;gam:City&gt;Seattle&lt;/gam:City&gt;
              &lt;gam:Name&gt;Seahawks&lt;/gam:Name&gt;
              &lt;gam:Abbreviation&gt;SEA&lt;/gam:Abbreviation&gt;
          &lt;/gam:homeTeam&gt;
          &lt;gam:location&gt;CenturyLink Field&lt;/gam:location&gt;
      &lt;/gam:game&gt;
      &lt;gam:quarterSummary&gt;
          &lt;gam:quarter number="1"&gt;
              &lt;gam:awayScore&gt;0&lt;/gam:awayScore&gt;
              &lt;gam:homeScore&gt;0&lt;/gam:homeScore&gt;
              &lt;gam:scoring/&gt;
          &lt;/gam:quarter&gt;
          &lt;gam:quarter number="2"&gt;
              &lt;gam:awayScore&gt;3&lt;/gam:awayScore&gt;
              &lt;gam:homeScore&gt;10&lt;/gam:homeScore&gt;
              &lt;gam:scoring&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;7:46&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;SEA&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;(7:14) R.Wilson pass short right to P.Richardson for 2 yards, TOUCHDOWN. Penalty on DET-T.Wilson, Defensive Pass Interference, declined.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;7:53&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;SEA&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;S.Hauschka extra point is GOOD, Center-T.Ott, Holder-J.Ryan.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;13:00&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;SEA&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;(2:00) S.Hauschka 43 yard field goal is GOOD, Center-T.Ott, Holder-J.Ryan.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;14:35&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;DET&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;(:25) M.Prater 51 yard field goal is GOOD, Center-D.Muhlbach, Holder-S.Martin.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
              &lt;/gam:scoring&gt;
          &lt;/gam:quarter&gt;
          &lt;gam:quarter number="3"&gt;
              &lt;gam:awayScore&gt;3&lt;/gam:awayScore&gt;
              &lt;gam:homeScore&gt;0&lt;/gam:homeScore&gt;
              &lt;gam:scoring&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;10:52&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;DET&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;(4:08) M.Prater 53 yard field goal is GOOD, Center-D.Muhlbach, Holder-S.Martin.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
              &lt;/gam:scoring&gt;
          &lt;/gam:quarter&gt;
          &lt;gam:quarter number="4"&gt;
              &lt;gam:awayScore&gt;0&lt;/gam:awayScore&gt;
              &lt;gam:homeScore&gt;16&lt;/gam:homeScore&gt;
              &lt;gam:scoring&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;0:45&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;SEA&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;(14:15) S.Hauschka 27 yard field goal is GOOD, Center-T.Ott, Holder-J.Ryan.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;6:07&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;SEA&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;(8:53) (Shotgun) T.Rawls right guard for 4 yards, TOUCHDOWN.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;11:17&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;SEA&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;(3:43) (Shotgun) R.Wilson pass short middle to D.Baldwin for 13 yards, TOUCHDOWN.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
                  &lt;gam:scoringPlay&gt;
                      &lt;gam:time&gt;11:24&lt;/gam:time&gt;
                      &lt;gam:teamAbbreviation&gt;SEA&lt;/gam:teamAbbreviation&gt;
                      &lt;gam:playDescription&gt;S.Hauschka extra point is GOOD, Center-T.Ott, Holder-J.Ryan.&lt;/gam:playDescription&gt;
                  &lt;/gam:scoringPlay&gt;
              &lt;/gam:scoring&gt;
          &lt;/gam:quarter&gt;
          &lt;gam:quarterTotals&gt;
              &lt;gam:awayScore&gt;6&lt;/gam:awayScore&gt;
              &lt;gam:homeScore&gt;26&lt;/gam:homeScore&gt;
          &lt;/gam:quarterTotals&gt;
      &lt;/gam:quarterSummary&gt;
  &lt;/gam:gameboxscore&gt;
  </code></pre>
  
  <p>Here is the most current version of the XSLT that I am using. Currently this is only giving me one record returned for the first scoring play.</p>
  
  <pre><code>    &lt;xsl:stylesheet version="2.0" xmlns:gam="http://leaguemanager.beacontender.com/plugin/feed/sport/usftbl/gameboxscore"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/&gt;
      &lt;xsl:template match="gam:gameboxscore"&gt;
          &lt;xsl:text&gt;GameDate,AwayTeam,HomeTeam,ScoringTeam,playDescription&amp;#13;&amp;#10;"&lt;/xsl:text&gt;
          &lt;xsl:value-of select="gam:game/gam:date"/&gt;
          &lt;xsl:text&gt;","&lt;/xsl:text&gt;
          &lt;xsl:value-of select="gam:game/gam:awayTeam/gam:Abbreviation"/&gt;
          &lt;xsl:text&gt;","&lt;/xsl:text&gt;
          &lt;xsl:value-of select="gam:game/gam:homeTeam/gam:Abbreviation"/&gt;
          &lt;xsl:text&gt;","&lt;/xsl:text&gt;
          &lt;xsl:value-of select="gam:quarterSummary/gam:quarter/gam:scoring/gam:scoringPlay/gam:teamAbbreviation"/&gt;
          &lt;xsl:text&gt;","&lt;/xsl:text&gt;
          &lt;xsl:value-of select="gam:quarterSummary/gam:quarter/gam:scoring/gam:scoringPlay/gam:playDescription"/&gt;
          &lt;xsl:text&gt;"&lt;/xsl:text&gt;
          &lt;xsl:text&gt;&amp;#13;&amp;#10;&lt;/xsl:text&gt;
      &lt;/xsl:template&gt;
      &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Thanks in advance!</p>