Document d = "<html><a><p>"; auto p = d.byTagName("p").front; p.outerHTML = "<div><a>"; assert(p.name == "p"); assert(d.body.descendants.front.name == "a");
See Implementation