Sony Mobile has added the Xperia XZs to its Open Device Program. Sony has a history of adding some of its key devices to its AOSP project, and now that the Xperia XZs has joined the program, it will enable budding developers to build your own custom version of Android Nougat software.
Sony already provides set of readily available instructions to build and flash AOSP, so all you’ll need to do is download the relevant software binaries before you get started. You can find further information at the source link below.
Via Sony Developer World.