What's the most elegant way of going from this:
<?xml version="1.0" encoding="UTF-8"?>
<foo>
<bar baz="wii" date="2009-01-01">
<baz value="0" />
<baz value="1" />
</bar>
<bar baz="wii" date="2009-01-02">
<baz value="0" />
<baz value="1" />
</bar>
<bar baz="xbox" date="2009-01-01">
<baz value="0" />
<baz value="1" />
</bar>
<bar baz="xbox" date="2009-01-02">
<baz value="0" />
<baz value="1" />
</bar>
</foo>
to this:
<foo>
<bar baz="wii" date="2009-01-02">
<baz value="0" />
<baz value="1" />
</bar>
<bar baz="xbox" date="2009-01-02">
<baz value="0" />
<baz value="1" />
</bar>
</foo>
Ideally, this is a function taking a "date" parameter. The obvious creation of and looping through to add each from an expression that returns IEnumerable<XElement> seems clunky so there's probably a nicer way.