title: How to iterate XML data using XSL without hardcoding element names?
body: <p>We're transforming this xml data into pipe-delimited format using XSL...</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt; 
  &lt;LIBRARY&gt; 
     &lt;BOOK&gt; 
          &lt;TITLE&gt;Professional JINI&lt;/TITLE&gt; 
          &lt;AUTHOR&gt;Sing Li&lt;/AUTHOR&gt;
          &lt;PUBLISHER&gt;Wrox Publications&lt;/PUBLISHER&gt;
     &lt;/BOOK&gt; 
  &lt;/LIBRARY&gt;
  </code></pre>
  
  <p>.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
      &lt;xsl:output method="text" indent="no"/&gt;
  
      &lt;!-- New line character variable --&gt;
      &lt;xsl:variable name="newline"&gt;
          &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
      &lt;/xsl:variable&gt;
  
      &lt;xsl:template match="/"&gt;         
          &lt;xsl:for-each select="LIBRARY/BOOK"&gt;
              &lt;xsl:value-of select="TITLE"/&gt;|&lt;xsl:value-of select="AUTHOR"/&gt;|&lt;xsl:value-of select="PUBLISHER"/&gt;   
              &lt;xsl:value-of select="$newline"/&gt;       
          &lt;/xsl:for-each&gt;
  
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>This is the output...</p>
  
  <pre><code>Professional JINI|Sing Li|Wrox Publications
  </code></pre>
  
  <p>Is there a way to get the values of TITLE, AUTHOR, etc..from without hard coding the element names in xsl:value-of? We want this XSL to be generic so that if we add more book attributes later the style sheet will automatically capture those new fields.</p>