error code added.
Minor tweaks to XML_Hander