>First thing is, the xml element eg. <node1>, <node2>.... cant be grouped as there is different names.
This isn't true. Muenchian grouping (
http://www.jenitennison.com/xslt/grouping) allows grouping on any computed value, e.g. translate(name(), '0123456789', ,,).
However, I don't think this is a true grouping problem because the list of possible values is known statically. In fact, it's a very straightforward problem, and the only reason I didn't attempt to respond is that I can't see where the difficulty lies. It's something like this:
<AllInfoGoing>
<xsl:for-each select="RailInformation[*[1]='Going']">
<xsl:copy-of select="*"/>
</xsl:for-each>
</AllInfoGoing>
<AllInfoComing>
<xsl:for-each select="RailInformation[*[1]='Coming']">
<xsl:copy-of select="*"/>
</xsl:for-each>
</AllInfoComing>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference