This is a grouping problem: you need to group the rows that have the same EntityID. For XSLT 1.0 look up Muenchian grouping (e.g. at
www.jenitennison.com), for 2.0 use <xsl:for-each-group>.
Then when processing each group, you output a row that contains the Name and the Ph, which can be obtained using fairly simple path expressions.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference