I would like to apply the method but first I need to understand its mechanism to avoid problems. Books or articles with examples would be very much appreciated.
You will find detailed information in the original CART book by Breiman et al.: Breiman, L., Friedman, J., Stone, C. J., & Olshen, R. A. (1984). Classification and regression trees. CRC press.
You will find chapters on CART in nearly every book on statistical learning/ machine learning/ data mining topics. I recommend the respective chapter in Hastie et al. (2009). The elements of statistical learning. 2001. New York: Springer.
The reference manuals for R packages always provide example code, see http://cran.r-project.org/web/packages/rpart/rpart.pdf for the CART implementation in R (package "rpart"). A detailed introduction to the rpart- package can be found here: http://cran.r-project.org/web/packages/rpart/vignettes/longintro.pdf