Execute the following command
$ docker run -it -v $PWD:/mnt/ --rm python:3.7-alpine sh
Install necessary libraries etc.
/ # cd mnt; apk add jq; pip install yq
Convert from yaml to json, json to xml
$ yq "." [Yml file you want to convert] > [Converted json file]