I am sorry but I am not sure what you are trying to do, maybe you can explain more detailed what you want to do? In gereral you just have to create an instance of the repository in order to access the items in there:

I actually opened my ranorex recorded solution in VS and that converted my repository to XML along with cs. On trying to add the existing repository to my solution, was only getting cs code, hence the question. I was kinda confuse.

Repository files (rxrep) are basically an xml file. Youc an add them to your VS solution for convenience and change the default programm to open them with to Ranorex Spy. (Right click in VS on your repository choose Open With, select Ranorex Spy and click Set as Default). To work with repositories in code you need to generate C# code from repository. (in Spy: Export and then Genrate C# code.)