Improved Xml document solution.