Improved xml APIs