diff --git a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
index feb796b68f..722c4db144 100644
--- a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
+++ b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
@@ -80,6 +80,7 @@ class XmlUtilsTest extends \PHPUnit_Framework_TestCase
array(array('foo' => null), ''),
array(array('foo' => 'bar'), 'bar'),
array(array('foo' => array('foo' => 'bar')), ''),
+ array(array('foo' => array('foo' => 0)), '0'),
array(array('foo' => array('foo' => 'bar')), 'bar'),
array(array('foo' => array('foo' => 'bar', 'value' => 'text')), 'text'),
array(array('foo' => array('attr' => 'bar', 'foo' => 'text')), 'text'),
diff --git a/src/Symfony/Component/Config/Util/XmlUtils.php b/src/Symfony/Component/Config/Util/XmlUtils.php
index f2ea98beed..494d7c3895 100644
--- a/src/Symfony/Component/Config/Util/XmlUtils.php
+++ b/src/Symfony/Component/Config/Util/XmlUtils.php
@@ -132,7 +132,7 @@ class XmlUtils
$nodeValue = false;
foreach ($element->childNodes as $node) {
if ($node instanceof \DOMText) {
- if (trim($node->nodeValue)) {
+ if (strlen(trim($node->nodeValue)) > 0) {
$nodeValue = trim($node->nodeValue);
$empty = false;
}