added some minor tweaks for nXML mode