# I am getting XML response and want to validate certain fields and that fields should not be blank

**URL:** <https://community.postman.com/t/i-am-getting-xml-response-and-want-to-validate-certain-fields-and-that-fields-should-not-be-blank/2183>\
**Category:** Help Hub\
**Tags:** xml-response\
**Created:** [July 30, 2018, 9:01am UTC](https://community.postman.com/t/i-am-getting-xml-response-and-want-to-validate-certain-fields-and-that-fields-should-not-be-blank/2183 "2018-07-30T09:01:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![farhan.quidwai](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@farhan.quidwai](https://community.postman.com/u/farhan.quidwai)\
**Post date:** [July 30, 2018, 9:01am UTC](https://community.postman.com/t/i-am-getting-xml-response-and-want-to-validate-certain-fields-and-that-fields-should-not-be-blank/2183/1 "2018-07-30T09:01:45Z")

</div>

I am getting XML response and want to validate certain fields and that fields should not be blank.

---

<div class="post-metadata">

**Author:** ![kunagpal](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kunagpal/32/9_2.png) [@kunagpal](https://community.postman.com/u/kunagpal)\
**Post date:** [August 4, 2018, 8:14am UTC](https://community.postman.com/t/i-am-getting-xml-response-and-want-to-validate-certain-fields-and-that-fields-should-not-be-blank/2183/2 "2018-08-04T08:14:08Z")

</div>

This can be done by converting the XML response to JSON and checking it’s individual fields, like so:

```auto
var json = xml2Json(pm.response.text());
// json is an object that contains fields which can be tested for validity.

```

---

<div class="post-metadata">

**Author:** ![farhan.quidwai](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@farhan.quidwai](https://community.postman.com/u/farhan.quidwai)\
**Post date:** [August 10, 2018, 12:50pm UTC](https://community.postman.com/t/i-am-getting-xml-response-and-want-to-validate-certain-fields-and-that-fields-should-not-be-blank/2183/3 "2018-08-10T12:50:26Z")

</div>

thanks alot for the help
