public void Unwrap_should_unwrap_nodes() { const string xml = @"<section> <dl> <dd class='f'><dl></dl> </dd> <dd class='e'><dl></dl></dd> </dl> </section>"; var doc = new DomDocument(); doc.LoadXml(xml); doc.QuerySelectorAll("dl").QuerySelectorAll("> dd").Unwrap(); Assert.Equal("<section>\n<dl>\n<dl />\n<dl />\n</dl>\n</section>", doc.CompressWhitespace().ToXmlString()); }