Optimized xml parsing