How to convert YDoc to Prosemirror JSON?

I have a Y.Doc and need to convert it to Prosemirror JSON to save the JSON format in my DB. I have tried the yDocToProsemirrorJSON function provided by the y-prosemirror package, but that is just returning an empty Prosemirror JSON.

Any suggestions on how I can achieve this?

How about some reproduction example? It’s working in the test cases.

I got the solution, was passing wrong XmlFragment, thus, getting an empty JSON as the response, thanks a lot.