xml: Use an optimized xpath search function for applying patch sets