using System.Collections.Generic;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO.Compression;
public static void Test()
var FilePath = @"Question66739322.xml";
File.WriteAllText(FilePath, GetXml());
var list = new List<Tuple<string, string>>();
var xmlReader = XmlReader.Create(FilePath);
while (xmlReader.ReadToFollowing("quoteNumber", ns))
string quoteNumber = null;
string orderNumber = null;
using (var inner = xmlReader.ReadSubtree())
switch (xmlReader.NodeType)
quoteNumber += inner.Value;
if (xmlReader.ReadToNextSibling("orderNumber", ns))
using (var inner = xmlReader.ReadSubtree())
switch (xmlReader.NodeType)
orderNumber += inner.Value;
if (quoteNumber != null && orderNumber != null)
list.Add(Tuple.Create(quoteNumber, orderNumber));
Console.WriteLine("Deserialized list:");
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(list, Newtonsoft.Json.Formatting.Indented));
static string GetXml() => @"<foo>
<![CDATA[ John Test 123]]>
public static void Main()
Console.WriteLine("Environment version: {0} ({1})", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , GetNetCoreVersion());
Console.WriteLine("Failed with unhandled exception: ");
public static string GetNetCoreVersion()
var assembly = typeof(System.Runtime.GCSettings).GetTypeInfo().Assembly;
var assemblyPath = assembly.CodeBase.Split(new[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries);
int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App");
if (netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2)
return assemblyPath[netCoreAppIndex + 1];