I have an XML document from which I need to extract a nodeset and add a namespace. So, from a doc I extract this:
<List>
<ListItem>
<SomeData>Here is some text</SomeText>
</ListItem>
<ListItem>
<SomeData>Here is some more text</SomeText>
</ListItem>
</List>
and need to create this:
<my:List xmlsns:my='http://SomeNamespace.org>
<my:ListItem>
<my:SomeData>Here is some text</my:SomeText>
</my:ListItem>
<my:ListItem>
<SomeData>Here is some more text</my:SomeText>
</my:ListItem>
</my:List>
There will be a variable quantity of list items and the elements might change and have different name, so I need a generic solution. Is there an easy way to do that in .Net C#?