I'm working on an all-Scratch HTML rendering engine. The goal here is to make it work, not make it work well or for the code to be pretty This accepts an XML string and 1: breaks it up into a list of tags and text nodes 2: for each opening tag, splits the contents by space into a list called attr<elemid> (<elemid> is the index of the item from the list in step 1). This includes the tagname, since the child lists in the next step only store the elemid 3: makes a children list called chil<elemid>. Each of the child elements is just their elemid, and text notes (which are prefixed with a double-quote to avoid any confusion) It strips whitespace at the beginning of text nodes. Besides that, everything will break it. right now there are a bunch of extra attr lists full of junk, but if you're only following the tree then you shouldn't run into them. A lotta help from http://limpet.net/mbrubeck/2014/08/11/toy-layout-engine-2.html