 <p>You need to make a <a href="http://php.net/manual/en/language.operators.string.php" rel="nofollow">concatenation in php</a></p> <p>in your example use "." instead of "+"</p> <p>$string = $userNode->getFirstName() . $userNode->getLastName();</p>