Many thanks, Pierre for your help! I found Samuel's approach a little bit more complicated since you have to install GO language, so followed your approach by tweaking a little bit the xslt template from your example. I would really appreciate it if you could take a look at it and tell me your thoughts cause I am not so familiar with XML.
Thank you very much in advance, Vasilis.
<xsl:stylesheet xmlns:d="<a href=" http:="" www.drugbank.ca"="" rel="nofollow">http://www.drugbank.ca" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="text"/>
<xsl:template match="d:drugbank">
<xsl:apply-templates select="d:drug"/>
</xsl:template>
<xsl:template match="d:drug">
<xsl:value-of select="d:name/text()"/>
<xsl:text> </xsl:text>
<xsl:for-each select="d:targets/d:target/d:polypeptide/d:gene-name">
<xsl:value-of select=" concat(./text(),',')"/>
</xsl:for-each>
<xsl:text> </xsl:text>
<xsl:for-each select="d:targets/d:target/d:actions/d:action">
<xsl:value-of select=" concat(./text(),',')"/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>