JavaScript: jQuery format XML with paddings