Since you want to sign the document element and not the entire document,
you first need to pass $doc->documentElement rather than $doc. This will
make it target the "Root" node. Also, if you want to preserve your
existing ID value, you need to also pass the "overwrite" option set to
false so that it will reuse "123456" rather than generating a new value.
So, the following code does what you expect:
$objDSig->addReference($doc->documentElement, XMLSecurityDSig::SHA1,
array('http://www.w3.org/2000/09/xmldsig#enveloped-signature'),
array('id_name' => 'ID', 'overwrite' => false));
Rob