The relative distribution of abundances of refractory, intermediate, and volatile elements in stars with planets can be an important tool for investigating the internal migration of a giant planet. This migration can lead to the accretion of planetesimals and the selective enrichment of the star with these elements. We report on a spectroscopic determination of the atmospheric parameters and chemical abundances of the parent stars in transiting planets . Adding data for CoRoT-3 and CoRoT-5 from the literature, we find a flat distribution of the relative abundances as a function of their condensation temperatures. For CoRoT-2, the relatively high lithium abundance and intensity of its Li i resonance line permit us to propose an age of 120 Myr, making this star one of the youngest stars with planets to date. We introduce a new methodology to investigate a relation between the abundances of these stars and the internal migration of their planets. By simulating the internal migration of a planet in a disk formed only by planetesimals, we are able, for the first time, to separate the stellar fractions of refractory, intermediate, and volatile rich planetesimals accreting onto the central star. Intermediate and volatile element fractions enriching the star are similar and much larger than those of pure refractory ones. This result is opposite to what has been considered in the literature for the accreting self-enrichment processes of stars with planets. We also show that these results are highly dependent on the model adopted for the disk distribution regions in terms of refractory, intermediate, and also volatile elements and other parameters considered. We note however, that this self-enrichment mechanism is only efficient during the first 20-30 Myr or later in the lifetime of the disk when the surface convection layers of the central star for the first time attain its minimum size configuration.