I hope this will work.
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.PreserveWhitespace = false;
xmlDocument.Load(@"file.xml");
XmlNode fieldNode = xmlDocument.SelectSingleNode(
@"/root/field[@name = '3']");
if (fieldNode != null) {
fieldNode.ParentNode.InsertBefore(fieldNode,
fieldNode.PreviousSibling);
}
xmlDocument.Save(Console.Out);