I used signedxml class for generating xml signature. And the result xml like below;
I don't really understand why do you want to add ds prefix in the namespace.
Having this:
Is totally equivalent to:
In the first case you have to specify ds for elements in http://www.w3.org/2000/09/xmldsig# namespace, in the second case this namespace is the default namespace so each element in the xml without declared prefix is from this namespace.
Furthermore you say that you need to add ds prefix in order to have a XAdES-BES, and you comment something about difference between xmldsig and xades signatures. You have to know that XAdES is only a specification which says what attributes are needed by an XMLDSIG signature to become XAdES signature. Roughly XAdES is an XMLDSIG signature which incorporates: that will be the bag for the whole set of qualifying properties, some of them signed (signedProperties) and some of them unsigned (unsignedProperties). For a XAdES-BES case you must add inside element.
Here I give you an example of XAdES-BES signature "without" ds prefix.
fiKTaqJzLSmC73cMXZSzjhd877w=
8ruIS/4MRp2wAwVX4/pTCYxTyWc=
R40YdEEEl0YIZVdl4pm3yyF7qGAG8ZN8PPf0aBRXbvRgdIcvJZtI5AS5NexaO5T4O0gMHWRIKjNb
2QzlfwxlQ3/KqMW4W0QkMLpF4csBpXt9bJ3t+smEeTnxkBcQRXAw5v9kwf20mfz1LtIUhbsU/PMd
YwaGCsItF2rzl3rtcq4=
MIIIUTCCBzmgAwI...
pb0cJioffffdCDVe/t+7...
AQAB
Hope this helps,