Using ultraviolet spectra obtained with the Cosmic Origins Spectrograph on the Hubble Space Telescope, we extend our previous ground-based optical determinations of the composition of the extrasolar asteroids accreted onto two white dwarfs, GD 40 and G241-6. Combining optical and ultraviolet spectra of these stars with He-dominated atmospheres, 13 and 12 polluting elements are confidently detected in GD 40 and G241-6, respectively. For the material accreted onto GD 40, the volatile elements C and S are deficient by more than a factor of 10 and N by at least a factor of 5 compared to their mass fractions in primitive CI chondrites and approach what is inferred for bulk Earth. A similar pattern is found for G241-6 except that S is undepleted. We have also newly detected or placed meaningful upper limits for the amount of Cl, Al, P, Ni and Cu in the accreted matter. Extending results from optical studies, the mass fractions of refractory elements in the accreted parent bodies are similar to what is measured for bulk Earth and chondrites. Thermal processing, perhaps interior to a snow line, appears to be of central importance in determining the elemental compositions of these particular extrasolar asteroids.