this c# code is probably not the most efficient but gets what I want done.
How do I accomplish the same thing in F# code?
string xml = ' <EmailList> ' + ' <Email>test@email.com</Email> ' + ' <Email>test2@email.com</Email> ' + ' </EmailList> '; XmlDocument xdoc = new XmlDocument(); XmlNodeList nodeList; String emailList = string.Empty; xdoc.LoadXml(xml); nodeList = xdoc.SelectNodes('//EmailList'); foreach (XmlNode item in nodeList) { foreach (XmlNode email in item) { emailList += email.InnerText.ToString() + Environment.NewLine ; } }
If you actually want the final trailing newline you can add it in the map and String.concat with the empty string.