Any wat to get structed svg code of selection in XD plugin?

I want to parse the svg structure in my XD plugin so that the XD file can be converted to a UI project in game engine with tree structure. I can get the SVG code I want by select some layers – right click – copy svg code now, but is there anyway to get the same svg code by javascript API?

The method in this link can only get a whole picture of the file without detailed structure :frowning:

Thanks for your help!