How do I check to see if an element exists within a given element before trying to add it?
Background: I have an XDocument
X
that contains as a child element Flowers
which subsequently contains a series of elements that are each named Flower
. Each Flower
already has 2 child elements and I would like to add a 3rd element called Price
. However, I want to check and make sure there's not already an element for Price
within the Flower
element. How do I do that? Do I even need to check?