This should do it
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.AppendChild( xmlDoc.CreateElement("NewQuery"));
XmlDocument xmlBlob = new XmlDocument();
xmlBlob.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"
?><WorkOrder><ProductID/><OrderDate/><ProductGroup><SerialNo/><SerialNo/><Se
rialNo/></ProductGroup></WorkOrder>");
xmlDoc.DocumentElement.AppendChild( xmlDoc.ImportNode(
xmlBlob.DocumentElement, true));
xmlBlob = new XmlDocument();
xmlBlob.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<WorkOrder><ProductID/><OrderDate/><ProductGroup><SerialNo/><SerialNo/><Seri
alNo/></ProductGroup></WorkOrder>");
xmlDoc.DocumentElement.AppendChild( xmlDoc.ImportNode(
xmlBlob.DocumentElement, true));
[quoted text, click to view] "Kathy Burke" <kathyburke40@attbi.com> wrote in message
news:eeifuH0aDHA.1204@TK2MSFTNGP12.phx.gbl...
> Hi, tried this a few weeks ago, but still need some help.
>
> I have a simple database table, fields: Customer, WorkOrder, xmlDoc.
>
> The xmlDoc fields contains a small blob of xml data, such as:
>
> <WorkOrder>
> <ProductID/>
> <OrderDate/>
> <ProductGroup>
> <SerialNo/>
> <SerialNo/>
> <SerialNo/>
> </ProductGroup>
> </WorkOrder>
>
> Based on a SQL query such as SELECT xmlDoc WHERE Customer = "xyz", I
> need to:
>
> 1) Create a new xmlDocument with only a root element such as <NewQuery>.
>
> 2) Bring each xmlDoc blob into the new xmlDocument within the NewQuery
> root.
>
> 3) Remove all the ?xml version="1.0"? processing instructions except for
> the first one so that the new xmlDocument is well formed...or remove
> them all then just add one back?
>
> Does anyone have an example I could see for something like this...or
> describe what I need to actually do.
>
> Thanks.
> Kathy
>
> *** Sent via Developersdex
http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!