Dimensional crossover in the XY-compound YBa2Cu3O6+x