Clone from http://xdt.codeplex.com/