One of the enhancements in YDK 0.4.0 was the introduction of the a Codec service (New Release of YDK has been posted (0.4.0)). This service allows you to encode a YDK object into and XML string or decode an XML string into a YDK object. You will find sample apps using this service at https://git.io/vViu2
That repo now groups basic sample apps by the service the use (e.g. CRUD, Codec). The new sample apps for the Codec service make use of the OpenConfig and XR native models for routing policies.
Make sure you review the README file for how to use these apps.