#### Topic: Interesting conversion XSLT

** At first the task seemed to me enough simple, but then I decided to address to professionals. **** Initial XML: **

```
<main>
<group name = "xxx">
<subgroup> value1 </subgroup>
<subgroup> value1 </subgroup>
<subgroup> value2 </subgroup>
<group name = "yyy">
<subgroup> value2 </subgroup>
<subgroup> value1 </subgroup>
<subgroup> value1 </subgroup>
<subgroup> value3 </subgroup>
<group name = "xxx">
<subgroup> value1 </subgroup>
<subgroup> value2 </subgroup>
</group>
</group>
</group>
</main>
```

** The Result should be: **

```
<main>
<subgroup group = "xxx" double = "5"> value1 </subgroup>
<subgroup group = "xxx" double = "5"> value1 </subgroup>
<subgroup group = "xxx" double = "3"> value2 </subgroup>
<subgroup group = "xxx/yyy" double = "3"> value2 </subgroup>
<subgroup group = "xxx/yyy" double = "5"> value1 </subgroup>
<subgroup group = "xxx/yyy" double = "5"> value1 </subgroup>
<subgroup group = "xxx/yyy/xxx" double = "5"> value1 </subgroup>
<subgroup group = "xxx/yyy/xxx" double = "3"> value2 </subgroup>
</main>
```

* I Ask to pay attention on value3, it in an individual type, means in finite XML should miss. *

**My sincere gratitude to the one who can the task solve one XSLT-transformation. If the decision is two conversions, with good optimization on speed, at great volumes of the data.**

**I very much respect this forum, therefore the request - not to write nonsense!**