If you are using 'ESB 4.7' it comes with default 'JSON' support, meaning the conversion to 'XML' should happen. You will set the property the same as you would for the 'XML' being passed.
<login><username>JohnDoe</username><pass>yourPass</pass><login> == {“login”:{“username”: ”JohnDoe”, "pass" : "yourPass"}}
<property name="username"
expression="//login/username/text()"
scope="default"
type="STRING"/>
Another option that will work if you want to keep the 'JSON' message intact without converting to XML which saves on performance you can use the 'evaluator'. There are a couple of things you need to do on the server to enable this feature. Un comment the 'MessageFormatter' & 'MessageBuilder' in the axis2.xml (The link I provided has those details)
<arg expression="$.login.username" evaluator="json"/>
Detailed Explanation & Example here : http://docs.wso2.org/wiki/display/ESB470/PayloadFactory+Mediator