ok now I have another question, is there any useful and cheap solution for searching all the placeholders? I mean placeholders are such sdt-tags and using xml I have to search for all of them, using the Open XML Format 2.0 I can get all elements of the body of the MainDocumentPart but the sdt-tags aren't only sdt this, there are sdtblocks, sdtruns etc.
Do you know a way to solve that? I read that it should be possible to use linq this time, but using this
doc.MainDocumentPart.Document.Body.Elements().Select(a => a.InnerText.Contains("sdt"));
won't work, because this returns a boolean expression but I need an OpenXMLElement. I know how to search them by using many many loops but it is really annoying, I thought linq could perhaps help me a bit, by searching only the elements where the InnerText (or the InnerXml) contains sdt. Then I would only search further in this elements.