I have a table with attributes

```
prodid  type    val
1       colour  red
1       size    large
2       colour  blue

```

I have as part of a larger query making a xml structure: 

```
(SELECT type "@type",val  from t_prodattr pa where pa.prodid=product.id 
 FOR xml path('attribute'), root('attributes'), type),

```

Giving

```
 <attributes>
    <attribute type="colour">
      <val>red</val>
    </attribute>
    <attribute type="size">
      <val>small</val>
    </attribute>
  </attributes>

```

I'd like xml to be

```
<attributes>
    <attribute type="colour">red</attribute>
    <attribute type="size">small</attribute>
</attributes>

```

or even

```
<attributes>
    <colour>red</colour>
    <size>small</size>
</attributes>

```