Critical Error, Could not create XML Structure from variable contents