No. Because of the way XML is defined, it is not possible to do tricks like this, where markup is generated by scripting while the parser is still parsing the markup.
You can still achieve the same effects, but you have to do it by using the DOM to add and delete elements.\
Why not work
a solution to chagne base class
Good way to rebuild a class
John ‘s orig way using a method
Basic things by hardcode
innerHTML null error in Xhtml