Improve XMl handling