If you are using R in ubuntu you probably would have the following problem. When you want to install XML package or curl package you are most likely will see the following error:
ERROR: configuration failed for package ‘XML’
The reason is that XML and curl development libraries are not install in your system. Use the following commands in ubuntu command line to install the libraries on the system
sudo apt-get install libxml2-dev
sudo apt-get install libcurl4-openssl-dev
Now, you can go to R and write:
install.packages("XML", dependencies=TRUE)