I was trying some grouping in xquery
<Sheets>
<Sheet>
<ROI>5350</ROI>
<TPI>830</TPI>
</Sheet>
<Sheet>
<ROI>5459</ROI>
<TPI>830</TPI>
</Sheet>
<Sheet>
<ROI>5350</ROI>
<TPI>856</TPI>
</Sheet>
<Sheet>
<ROI>5678</ROI>
<TPI>856</TPI>
</Sheet>
<Sheet>
<ROI>17473</ROI>
<TPI>856</TPI>
</Sheet>
<Sheet>
<ROI>5350</ROI>
<TPI>857</TPI>
</Sheet>
<Sheet>
<ROI>5713</ROI>
<TPI>857</TPI>
</Sheet>
</Sheets>
in my xquery, i want to pass a dynamic value say number 4... i want my xml to group to 4 Sheet elements to one set like
<Sheets>
<set>
<Sheet>
<ROI>5350</ROI>
<TPI>830</TPI>
</Sheet>
<Sheet>
<ROI>5459</ROI>
<TPI>830</TPI>
</Sheet>
<Sheet>
<ROI>5350</ROI>
<TPI>856</TPI>
</Sheet>
<Sheet>
<ROI>5678</ROI>
<TPI>856</TPI>
</Sheet>
</set>
<set>
<Sheet>
<ROI>17473</ROI>
<TPI>856</TPI>
</Sheet>
<Sheet>
<ROI>5350</ROI>
<TPI>857</TPI>
</Sheet>
<Sheet>
<ROI>5713</ROI>
<TPI>857</TPI>
</Sheet>
</set>
</Sheets>
like, group 4 sheets to one set and other 4 to one set and finally rest of them to one set