{"id":399,"date":"2016-10-11T02:49:46","date_gmt":"2016-10-11T02:49:46","guid":{"rendered":"http:\/\/waynenguyen.org\/dev\/?p=399"},"modified":"2016-10-11T02:49:46","modified_gmt":"2016-10-11T02:49:46","slug":"this-document-already-has-a-documentelement-node","status":"publish","type":"post","link":"https:\/\/bruceng.com\/dev\/?p=399","title":{"rendered":"This document already has a &#8216; DocumentElement &#8216; node"},"content":{"rendered":"<p>I faced this exception\u00a0while trying to generate a xml document programmatically in C# using XmlDocument and XmlElement.<\/p>\n<p>I didn&#8217;t know what was going on, and then I figured out that I was adding multiple elements to the XmlDocument. To solve this, add a &#8220;root&#8221; element to XmlDocument and then add multiple child elements within the root. The XmlDocument is supposed to only contain 1 child element as expected in XML.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I faced this exception\u00a0while trying to generate a xml document programmatically in C# using XmlDocument and XmlElement. I didn&#8217;t know what was going on, and then I figured out that I was adding multiple elements to the XmlDocument. To solve this, add a &#8220;root&#8221; element to XmlDocument and then add multiple child elements within the &hellip; <a href=\"https:\/\/bruceng.com\/dev\/?p=399\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;This document already has a &#8216; DocumentElement &#8216; node&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[7,43,62],"class_list":["post-399","post","type-post","status-publish","format-standard","hentry","category-problems","tag-c","tag-xml","tag-xmldocument"],"_links":{"self":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=399"}],"version-history":[{"count":1,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions"}],"predecessor-version":[{"id":400,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions\/400"}],"wp:attachment":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}