Keeping namespaces

Nov 3, 2011 at 4:03 PM

Start with an xml like this:

<?xml version="1.0" encoding="UTF-8"?>

<inventory xmlnx="http://inventory" xmlns:pro="http://product">

<pro:product>Items 1</pro:product>

</inv:inventory>

 Deserialize this in an object created from the XSD and save it to a file. the http://product is removed from the result and the result will look like this:

<?xml version="1.0" encoding="UTF-8"?>

<inv:inventory xmlnx="http://inventory" >

<product xmlns="http://product>Items 1</product>

</inv:inventory>

 

If there are a lot of <pro:product> the resultant file would be much bigger. Is there anyway to keep and use the namespaced when deserializing?