i have a xml tag like :
<p xmlns="http://www.w3.org/1999/xhtml">Text1<span title="instruction=componentpresentation,componentId=1234,componentTemplateId=1111">CPText2CP</span></p>
If i have to replace the tag <span title="instruction=componentpresentation,componentId=1234,componentTemplateId=1111">CPText2CP</span> with
<componentpresentation componentID="1234" templateID="1111" dcpID="dcp1111_1234" dcplocation="/wip/data/pub60/dcp/txt/dcp1111_1234.txt">Text2</componentpresentation>
Is any possible way to acchive this, please give suggestion/changes.
EDIT
From the above tag can i take full <span></span> tag as a string with the text in between the tags.any suggestions.
You can do it like this:
Your needs may vary but the way to go would be to create
XDocumentorXElement, search through it to find elements that need to be replaced and then useReplaceWithto replace them. Note that you have to take namespaces into consideration, otherwise elements won’t be retrieved.