AppendChild should take a Node not Element as per DOM

As per DOM API https://developer.mozilla.org/en-US/docs/Web/API/Node

This is needed so Text nodes can be used with AppendChild.