I'm not too familiar with these libxml routines unfortunately.  Could you quickly explain what's going on here and how these c functions come into play when resolving things in Go?  At least for me, the control flow seems somewhat confusing.