Dzięki za odpowiedzi.
Nie jestem gimbusem, który od razu pyta na forum nie szukając wcześniej rozwiązań.
Drugi dzień już się z tym biję i wujka Google już dokładnie przerobiłem jak również dostępną mi literaturę.
plik xml
<?xml version="1.0" encoding="utf-8"?>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="">
<ds:SignedInfo Id="">
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference Id="" URI="#Dokument">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue></ds:DigestValue>
</ds:Reference>
<ds:Reference Id="" URI="" Type="http://uri.etsi.org/01903#SignedProperties">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue></ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue Id="">
</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate></ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<ds:Object>
<xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Id="" Target="">
<xades:SignedProperties Id="">
<xades:SignedSignatureProperties>
<xades:SigningTime></xades:SigningTime>
<xades:SigningCertificate>
<xades:Cert>
<xades:CertDigest>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue></ds:DigestValue>
</xades:CertDigest>
<xades:IssuerSerial>
<ds:X509IssuerName></ds:X509IssuerName>
<ds:X509SerialNumber></ds:X509SerialNumber>
</xades:IssuerSerial>
</xades:Cert>
</xades:SigningCertificate>
</xades:SignedSignatureProperties>
<xades:SignedDataObjectProperties>
<xades:DataObjectFormat ObjectReference="#Dokument">
<xades:Description>Dokument w formacie xml [XML]</xades:Description>
<xades:MimeType>text/plain</xades:MimeType>
<xades:Encoding>http://www.w3.org/2000/09/xmldsig#base64</xades:Encoding>
</xades:DataObjectFormat>
</xades:SignedDataObjectProperties>
</xades:SignedProperties>
</xades:QualifyingProperties>
</ds:Object>
<ds:Object Id="Dokument" MimeType="text/xml">
</ds:Object>
</ds:Signature>
np. pomiędzy xades:SigningTime</xades:SigningTime> chcę wstawić DateTime.Now
Wypróbowałem już różne sposoby, ale niestety nie mam wyniku jakiego oczekuję.
Za pomocą kodu poniżej wczytuję xml, ustawiam atrybuty ale nie mogę ustawić wartości elementu.
XmlDocument wzor = new XmlDocument();
wzor.PreserveWhitespace = true;
wzor.Load(@"C:\wzorxml.xml");
XmlNamespaceManager nsmgrSP = new XmlNamespaceManager(wzor.NameTable);
nsmgr.AddNamespace("xades", "http://uri.etsi.org/01903/v1.3.2#");
nsmgr.AddNamespace("ds", "http://www.w3.org/2000/09/xmldsig#");
XmlElement sigElem = (XmlElement)myDoc.SelectSingleNode("/ds:Signature",nsmgr);
sigElem.SetAttribute("Id", strSigID);