diff --git a/src/Symfony/Components/Console/Application.php b/src/Symfony/Components/Console/Application.php index d0ede9fd9a..8438d63ab5 100644 --- a/src/Symfony/Components/Console/Application.php +++ b/src/Symfony/Components/Console/Application.php @@ -633,10 +633,7 @@ class Application $commandXML->appendChild($dom->createTextNode($command->getName())); } - $commandXML = new \DOMDocument('1.0', 'UTF-8'); - $commandXML->formatOutput = true; - $commandXML->loadXML($command->asXml()); - $node = $commandXML->getElementsByTagName('command')->item(0); + $node = $command->asXml(true)->getElementsByTagName('command')->item(0); $node = $dom->importNode($node, true); $commandsXML->appendChild($node);