I have an XML file that has duplicate record in it. In SQL Server I would do a SELECT DISTINCT. How can I achieve this with XML.
For example
<Pupils>
<Pupil pupilid="20">
<Name>Test test</Name>
</Pupil>
<Pupil pupilid="19">
<Name>Test Pupil</Name>
</Pupil>
<Pupil pupilid="20">
<Name>Test test</Name>
</Pupil>
<Pupil pupilid="20">
<Name>Test test</Name>
</Pupil>
</Pupils>
How would I return distinct <Pupil> records using the pupilid?
For example
<Pupils>
<Pupil pupilid="20">
<Name>Test test</Name>
</Pupil>
<Pupil pupilid="19">
<Name>Test Pupil</Name>
</Pupil>
<Pupil pupilid="20">
<Name>Test test</Name>
</Pupil>
<Pupil pupilid="20">
<Name>Test test</Name>
</Pupil>
</Pupils>
How would I return distinct <Pupil> records using the pupilid?