Further clean up of XML handling.