Convert Gh_UserObject to GH_Component

Hello,

I’m trying to load a GH_UserObject by code and add it to a GH_Document wich is in memory

var myUserObj = new GH_UserObject(path);

But I don’t know how to convert it to a GH_DocumentObject, GH_Component or IGH_Component in order to add it to the document
.
Does anybody how to do it?

Thanks in advance.