How can I print the value of the node body using PHP with the text format applied?
I believe you're looking for the check_markup() function:

Runs all the enabled filters on a piece of text.
Note: Because filters can inject JavaScript or execute PHP code, security is vital here. When a user supplies a text format, you should validate it using filter_access() before accepting/using it. This is normally done in the validation stage of the Form API. You should for example never make a preview of content in a disallowed format.

E.g.
$markup = check_markup($body[0]['value'], $body[0]['format']);