Added code to build ab XML document.