This lesson shows you how to create root and child elements in the DOM tree. We will first create a blank DOM document and add the root element to it. Then I show you how to add comment element and then child element to the root element. In this example following xml code will generated and displayed on the console.
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is comment-->
<Child attribute1="The value