in reply to XML::LibXML creating nodes with a string OR a node

choroba already gave you the answer; just two minor nitpicks:

Putting perl -w on the shebang line enables warnings everywhere, even in modules not under your control; putting a use warnings; at the top of the script instead is usually better as only affects the current lexical scope (i.e. your code).

Calling functions with the &foo(...) style is not necessary, foo(...) is sufficient. The former ignores prototypes, which is the kind of thing one should only do on purpose.