I have below xml and need to transform it using mule data weave transformation.
<Colleges>
<College>
<name>C1</name>
<Students>
<Student>
<name>s1</name>
<dept>d1</dept>
</Student>
<Student>
<name>s2</name>
<dept>d2</dept>
</Student>
<Student>
<name>s3</name>
<dept>d3</dept>
</Student>
<Student>
<name>s4</name>
<dept>d3</dept>
</Student>
</Students>
</College>
</Colleges>
I want to transform it to below xml by getting unique departments from above xml.
<Departments>
<name>d1</name>
<name>d2</name>
<name>d3</name>
</Departments>
Any suggestion would be helpful.