private static void AddElement() { Element toBeAdded = new Element() { Name = Console.ReadLine() }; Element onWhich = Search(); xml.AddElement(toBeAdded, onWhich); }