Format xml into pretty format using javascript