Wrapping an additional element around an existing XDocument
- by user1382827
Let's say I have a converted HTML document, and I wanted to wrap an extra tag around the parent, so that I could read the head and body. How would I do that with C#? The file is used as an XDocument.
change
<html>
<head>
<!-- data -->
</head>
<body>
<!-- data -->
</body>
</html>
to
<open>
<html>
<head>
<!-- data -->
</head>
<body>
<!-- data -->
</body>
</html>
</open>