I'm going to convert the first XML into the second one using XSLT transformation
First:
<Data>
<Time>
<ID>IDvalue1</ID>
<field1>PropertyValue1</field1>
<field2>PropertyName1</field2>
</Time>
<Time>
<ID>IDvalue2</ID>
<field1>PropertyValue2</field1>
<field2>PropertyName1</field2>
</Time>
<Time>
<ID>IDvalue1</ID>
<field1>PropertyValue3</field1>
<field2> PropertyName2</field2>
</Time>
<Time>
<ID>IDvalue2</ID>
<field1>PropertyValue4</field1>
<field2>PropertyName2</field2>
</Time>
</Data>
....
Second:
<Data>
<Time>
<ID>IDvalue1</ID>
<PropertyName1>PropertyValue1</PropertyName1>
<PropertyName2>PropertyValue3</PropertyName2>
</Time>
<Time>
<ID>IDvalue2</ID>
<PropertyName1>PropertyValue2</ PropertyName1>
<PropertyName2>PropertyValue4</PropertyName2>
</Time>
</Data>
.....
In the first XML there number of ID nodes which have same values. In the second XML they are compiled into a single nodes. After each ID in the first XML there are field1 and field2 nodes. In the second XML new nodes have to be created where field2 is tag name and field1 is value. These new nodes are gathered from all ID nodes with same value.
Could you help me to write XSLT code?