It is good practice to logout before ending a connection. Of course, you can just end your connection and assume the system will log you out, but in some cases this will leave a session open, which needs a timeout to be closed. You might reach your maximum number of allowed sessions quite fast if you are logging in and closing the connection often without logging out.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<logout/>
<clTRID>MTR-12345</clTRID>
</command>
</epp>
The response is also quite simple, and will always give code 1500 (the second digit shows the session has ended)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<response>
<result code="1500">
<msg>Command completed successfully; ending session</msg>
</result>
<trID>
<clTRID>MTR-12345</clTRID>
<svTRID>54321-XYZ</svTRID>
</trID>
</response>
</epp>