<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format">

  <xsl:template match="/">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

      <fo:layout-master-set>
      
        <fo:simple-page-master master-name="A4"
           page-width="297mm"  page-height="210mm"
           margin-top="0.5in"  margin-bottom="0.5in"
           margin-left="0.5in" margin-right="0.5in">
          <fo:region-body/>
        </fo:simple-page-master>
      
      </fo:layout-master-set>

      <fo:page-sequence master-name="A4">
        
        <fo:flow flow-name="xsl-region-body">
          <fo:table>
            <fo:table-column column-width="30mm"/>
            <fo:table-column column-width="12mm"/>
            <fo:table-column column-width="12mm"/>
            <fo:table-column column-width="25mm"/>
            <fo:table-column column-width="27mm"/>
            <fo:table-column column-width="18mm"/>
            <fo:table-column column-width="49mm"/>
            <fo:table-column column-width="16mm"/>
            <fo:table-column column-width="16mm"/>
            <fo:table-column column-width="16mm"/>
            <fo:table-column column-width="21mm"/>
            <fo:table-column column-width="21mm"/>
            <fo:table-column column-width="21mm"/>
            <fo:table-body>
              <xsl:apply-templates select="//ATOM">
                <xsl:sort data-type="number" select="ATOMIC_NUMBER"/>
              </xsl:apply-templates>
            </fo:table-body>
          </fo:table>
        </fo:flow>
        
      </fo:page-sequence>

    </fo:root>
  </xsl:template>

  <xsl:template match="ATOM">
    <fo:table-row>
      <fo:table-cell><fo:block><xsl:value-of select="NAME"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="SYMBOL"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="ATOMIC_NUMBER"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="ATOMIC_WEIGHT"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="OXIDATION_STATES"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="DENSITY"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="ELECTRON_CONFIGURATION"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="ELECTRONEGATIVITY"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="ATOMIC_RADIUS"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="ATOMIC_VOLUME"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="SPECIFIC_HEAT_CAPACITY"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="SPECIFIC_HEAT_CAPACITY"/></fo:block></fo:table-cell>
      <fo:table-cell><fo:block><xsl:value-of select="THERMAL_CONDUCTIVITY"/></fo:block></fo:table-cell>
    </fo:table-row>
  </xsl:template>

</xsl:stylesheet>
