I edited the OP after your post to show an example I created that helped me understand the part I was having trouble with. As you can see it isn't HTML but XML. The documents I work with represent electrical diagrams that are created by a graphical drawing program.