When to use documentToXMLValues & pub.document:XMLValuesToDocument

Can someone give me some examples where the following built-in services would be useful?
pub.document:documentToXMLValues
pub.document:XMLValuesToDocument