Xavi Hernández's men narrowly defeated Alavés in a difficult match at the Estadi Olímpic Lluís Companys.