<?xml version="1.0"?>
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">

    <xsl:template match="/PERIODIC_TABLE">
      <html>
        <body>
          <h1>Atomic Number vs. Melting Point</h1>
          <table>
            <th>Element</th>
            <th>Atomic Number</th>
            <th>Melting Point</th>
            <xsl:apply-templates/>
          </table>
        </body>
      </html>
    </xsl:template>
    
    <xsl:template match="ATOM">
      <xsl:apply-templates 
       select="from-children(MELTING_POINT)"/>
    </xsl:template>
    
    <xsl:template match="MELTING_POINT">
       <tr>
        <td>
          <xsl:value-of 
           select="from-parent(*)/from-children(NAME)"/>
        </td> 
        <td>
          <xsl:value-of 
           select="from-parent(*)/from-children(ATOMIC_NUMBER)"/>
        </td>
        <td>
          <xsl:value-of select="from-self(*)"/>
          <xsl:value-of select="from-attributes(UNITS)"/>
        </td>
      </tr>
   </xsl:template>
    
</xsl:stylesheet>