basic writer / reader for PNML