Consider a regular octagon \(ABCDEFGH\) inscribed in a circle. A square \(ABXY\) is constructed such that side \(AB\) of the square coincides with side \(AB\) of the octagon. Determine the measure of angle \(XEG\). Let's think step by step and output the final answer within \boxed{}.
user