read XML in a more efficient manner