create element takes an element name, not attributes as well xmldocument.createElement("value-of") 2) you need to create and associate a namespace for the document for xsl to the xsl uri 3) when you do 1) above, pass 2) as the second parameter 4) you need to call setattibute on the element create to add the select.
"When the only tool you have is a hammer, a sore thumb you will have."