I'm sorry for your pain at this time, GAG. You were there as such a wonderful friend and support to XMIL and to XSIL and XH.
Ask XH if it's alright for you to attend the funeral as a courtesy but know in your heart that it is your rightful place. As the others have said it's really about your relationship with XMIL, not your relationship with anyone else.