converted to cElementTree for faster performance and lower memory usage.