Added convert to XML function