What's the best way to move "a child up" in a .NET XmlDocument?
- by Mike
Given an XML structure like this:
<garage>
<car>Firebird</car>
<car>Altima</car>
<car>Prius</car>
</garage>
I want to "move" the Prius node "one level up" so it appears above the Altima node. Here's the final structure I want:
<garage>
<car>Firebird</car>
<car>Prius</car>
<car>Altima</car>
</garage>
So given the C# code:
XmlNode priusNode = GetReferenceToPriusNode()
What's the best way to cause the priusNode to "move up" one place in the garage's child list?