Charles IV married his first cousin Princess Maria Luisa , the daughter of Philip , Duke of Parma , in 1765 . Charles IV married his first cousin Maria Louisa , the daughter of Philip , Duke of Parma , in 1765 .