Function to convert any javascript object to xml string