Hi,

I have a user table that have columns such as username, emailAddress, fullName etc.. (+ more columns)

My question is how can I use FOR XML EXPLICIT to generate XML format such as this:

<MyElements>
<Item>
<username>johnd</username>
<emailAddress>johndoe@email.com</emailAddress>
<fullName>John Doe</fullName>
</Item>
<Item>
<username>someusername</username>
<emailAddress>someuser@email.com</emailAddress>
<fullName>Some User</fullName>
</Item>
<Item>
.......
</Item>
</MyElements>


The <MyElements> and <Item> tags have to be hardcoded.

I've been looking at some examples using FOR XML EXPLICIT, but I haven't really managed to generate such a result + the examples I saw all added attributes to the generated xml (which I dont want).

If anyone could give an example on how to generate this kind of XML I would greatly appreciate it.

Thanks

Br,
Dag