select formatid, name, genmac,v.query('.') circle from formats cross apply genmac.nodes('//g[@id="C0"]') tmpxml(v)