You probably want to make "&lt;table />", "&lt;th/>", "&lt;td/>" and "&lt;tr/>" into string variables and use them in your node creation functionality