Convert CPN file in Java Object and vice-versa