They are completely different. XMLValuesToDocument decodes what wM calls an “XMLValues-encoded document” which can be produced using pub.document:documentToXMLValues. You normally won’t use either of these but try them out to see how they operate.
The documentation is your friend. Don’t let your friend be ignored.