# How to assert xml response

**URL:** <https://community.postman.com/t/how-to-assert-xml-response/24634>\
**Category:** Help Hub\
**Tags:** tests, collections\
**Created:** [June 8, 2021, 6:53am UTC](https://community.postman.com/t/how-to-assert-xml-response/24634 "2021-06-08T06:53:34Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![khan\_aktas](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/khan_aktas/32/8816_2.png) [@khan\_aktas](https://community.postman.com/u/khan_aktas)\
**Post date:** [June 13, 2021, 10:49pm UTC](https://community.postman.com/t/how-to-assert-xml-response/24634/11 "2021-06-13T22:49:37Z")

</div>

I figured out how I can do it, here is an example

```auto
var responseJson1 = xml2Json(pm.response.text());
console.log(responseJson1);
pm.expect(pm.response.text()).to.include("sometext or tagname");
pm.expect(pm.response.text()).to.include(pm.variables.replaceIn('{{somevalue}}'));

```

---

_[View the full topic](https://community.postman.com/t/how-to-assert-xml-response/24634)._
