I had to use $.html()
not $.xml()
Here is that in context based on this answer
// Finally write the font with the modified paths
fs.writeFile("test.html", $.html(), function(err) {
if(err) {
throw err;
}
console.log("The file was saved!");
});