public Guk ToGuk() { Guk guk = new Guk(); guk.SetType(Type, false); if (isSub) { guk.SetAttr("isSub", null); } Entries.ForEachPairs((index, entry) => { Guk sub = guk.CreateSubNode(StrGen.Start("<").Append(entry.species).Append(':').Append(index).Append(" />").End); sub.SetAttr("name", entry.name, false); sub.SetAttr("type", entry.type, false); entry.Flags.ForEachPairs((k, v) => sub.SetAttr(k, v, false)); }); return(guk); }