The FOR XML command uses column names to create the XML nodes. I need my nodes to be named after values I'm getting from the database. As far as I know you can't do something such as
SELECT Key AS Section
SECTION | KEY | VALUE
-----------------------------------------------------------
PageAddProduct | ErrorDateFormat | Incorrect value
PageAddProduct | ErrorNotSelected | Please select value
WidgetLogin | Title | Connexion
WidgetLogin | MailLabel | Mail
This is the desired XML output
<Resources>
<WidgetLogin>
<Title>Connexion</Title>
<MailLabel>Mail</MailLabel>
</WidgetLogin>
</Resources>
Not sure if you can get this with For Xml. Help would be much appreciated.