diff --git a/src/Configurator/RendererGenerators/PHP/XPathConvertor.php b/src/Configurator/RendererGenerators/PHP/XPathConvertor.php
index <HASH>..<HASH> 100644
--- a/src/Configurator/RendererGenerators/PHP/XPathConvertor.php
+++ b/src/Configurator/RendererGenerators/PHP/XPathConvertor.php
@@ -304,7 +304,7 @@ class XPathConvertor
 				$operators['=']  = '==';
 				$operators['!='] = '!=';
 
-				$operands[] = ltrim($expr, '0');
+				$operands[] = preg_replace('(^0(.+))', '$1', $expr);
 			}
 			else
 			{
diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php
index <HASH>..<HASH> 100644
--- a/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php
+++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php
@@ -361,6 +361,10 @@ class XPathConvertorTest extends Test
 				"\$node->textContent==3"
 			],
 			[
+				'.=0',
+				"\$node->textContent==0"
+			],
+			[
 				'.=022',
 				"\$node->textContent==22"
 			],
XPathConvertor: fixed comparison to 0