xmldoc changes and some tweaks