This stylesheet:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="name">
<xsl:variable name="vFollowing"
select="count(following-sibling::name)"/>
<xsl:value-of
select="concat(.,substring(', ',1 div ($vFollowing > 1)),
substring(' and ',1 div ($vFollowing = 1)),
substring('.',1 div ($vFollowing = 0)))"/>
</xsl:template>
</xsl:stylesheet>
Output:
Lorem Ipsum, Lorem Ipsum, Lorem Ipsum and Lorem Ipsum.
EDIT: Also with fn:position()
and fn:last()
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="name">
<xsl:value-of
select="concat(.,substring(', ',1 div (last()-1 > position())),
substring(' and ',1 div (last()-1 = position())),
substring('.',1 div (last()=position())))"/>
</xsl:template>
</xsl:stylesheet>
EDIT 2: The pattern matching solution.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="name">
<xsl:value-of select="concat(.,', ')"/>
</xsl:template>
<xsl:template match="name[last()-1 = position()]">
<xsl:value-of select="concat(.,' and ')"/>
</xsl:template>
<xsl:template match="name[last()]">
<xsl:value-of select="concat(.,'.')"/>
</xsl:template>
</xsl:stylesheet>