# WebService response to XML

**URL:** <https://forum.cloverdx.com/t/webservice-response-to-xml/1347>\
**Category:** CloverDX Platform\
**Created:** [February 10, 2014, 12:00am UTC](https://forum.cloverdx.com/t/webservice-response-to-xml/1347 "2014-02-10T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmsrihari](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@kmsrihari](https://forum.cloverdx.com/u/kmsrihari)\
**Post date:** [February 10, 2014, 12:00am UTC](https://forum.cloverdx.com/t/webservice-response-to-xml/1347/1 "2014-02-10T00:00:00Z")

</div>

Hi all,

I’ve invoked a Rest web service (Accepting application/xml) using HTTPConnector. Now I just want to manipulate some fields from this response XML to a new XML file. The web service response XML looks like the one below,

```auto

<?xml version='1.0' encoding='UTF-8'?>
<product>
	<code>100191</code>
	<categories>
		<category>
			<code>snow</code>
			<url>/Collections/Snow/c/snow</url>
		</category>
		<category>
			<code>Armada</code>
			<url>/Brands/Armada/c/Armada</url>
		</category>
	</categories>
</product>

```

The new XML which is to be created out of the above will have the following structure,

```auto

    <Products>
        <Product>
            <ExternalId>100191</ExternalId>
            <Categories>
				<Category>snow</Category>
				<Category>Armada</Category>
			</Categories>
        </Product>
    </Products>

```

Any help to achieve this? Please let me know if you need more information.

---

<div class="post-metadata">

**Author:** ![David\_Hlidek](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@David\_Hlidek](https://forum.cloverdx.com/u/David_Hlidek)\
**Post date:** [February 11, 2014, 8:07am UTC](https://forum.cloverdx.com/t/webservice-response-to-xml/1347/2 "2014-02-11T08:07:31Z")

</div>

Hi kmsrihari,

I expect you have prepared HttpConnector which produces record on output edge. Record’s metadata contains field “content” of string type which contains downloaded XML.

Then use one of our XML components:  
[\*] [http://doc.cloveretl.com/documentation/ … eader.html](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/xmlreader.html)  
[\*] [http://doc.cloveretl.com/documentation/ … eader.html](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/xmlxpathreader.html)  
[\*] [http://doc.cloveretl.com/documentation/ … tract.html](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/xmlextract.html)

Set “File URL” to “port:$0.content:discrete”. See [http://doc.cloveretl.com/documentation/ … aders.html](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/examples-of-file-url-in-readers.html) section “Reading from Input Port” for details.

I hope this helps.
