Some useful filters. Put filters in ~/Library/Application Support/BBEdit/Text Filters. They must be bash scripts.
XML Format.sh
#!/bin/bash
xmllint --format -
JSON Format.sh
#!/bin/bash
python -m json.tool
Contrary to another suggestion, I did not like using plutil as it is fussy about the kind of XML it formats.