The install.packages method
You need to install the ubuntu package libxml2-dev
So in a shell prompt type:
sudo apt-get update
sudo apt-get install libxml2-dev
You will need special sudo
powers for this.
Ubuntu package method
As Richie and Dirk mentioned, you can also use:
sudo apt-get install r-cran-xml
If you go down this path, I would recommend that you check out the R ubuntu sources page which will ensure you have a current version of R and the associated R packages. This could be important if you are using the LTS version of ubuntu.