Does a plant filter out contaminates from soil. And if there is contiminate...
Some heavy metals for example can be taken up and concentrated in the plant, other compounds may be taken up, inactivated, and safened.
DO you have a specific compound you are concerned about?
Here is some reading on the topic: http://www.ncbi.nlm.nih.gov/pubmed/16393813
Phytoremediation is a way to use plants to assist in the removal of heavy metals: http://www.plantstress.com/articles/toxicity_m/phytoremed.pdf
And a pretty detailed review of the literature from Sweden that may help frame more of your questions: http://info1.ma.slu.se/IMA/Publikationer/internserie/2004-01.pdf