open System.IO open System.Xml.XPath let xml = new StringReader("""
Invisibility Cream 14.50 Makes you invisible Levitation Salve 23.99 Levitate yourself for up to 3 hours per application
Blork and Freen Instameal 4.95 A tasty meal in a tablet; just add water Grob winglets 3.56 Tender winglets of Grob. Just add water
""") let nav = XPathDocument(xml).CreateNavigator() // first "item"; throws if none exists let item = nav.SelectSingleNode(@"//item[1]") // apply a operation (print text value) to all price elements for price in nav.Select(@"//price") do printfn "%s" (price.ToString()) // array of all name elements let names = seq { for name in nav.Select(@"//name") do yield name } |> Seq.toArray