I have a XML document that looks like the following

<xmlrootnode>
<person>
<childeren>
<child>
<id>1</id>
</child>
</childeren>
</person>
<person>
<childeren>
<child>
<id>2</id>
</child>
</childeren>
</person>
<person>
<childeren>
<child>
<id>2</id>
</child>
</childeren>
</person>
</xmlrootnode>

I need to convert this to the following:
<person>
<childeren>
<child id="1"/>
<child id="2"/>
</childeren>
</person>

As you can see I want to filter on ID and discard any doubles.
Has anybody have an idea to solve this. I don't want to use JavaScript within the XSL.

Greetings,


Jeroen