Ive got this class which builds up an XML document using PHP DOM, unfortunately I have come across a problem with spaces when creating XML nodes. e.g: "Category Name". I get a message:

"Uncaught exception 'DOMException' with message 'Invalid Character Error'"

I need the XML file to comply with shopping.com's XML template which has plenty of these nodes with spaces in

Any ideas would be great.