pass pin and passphrase as parameters
add more structure to xml