Check out this thread: How to iterate through component via .NET(such as C#, in DxD or XDx)
It does not specifically pick out composite symbols, but the easy way to do that is make a separate list of reference designators from each component and key off the ones that are repeated.