Added format xml function