That man of sin is almost certainly the Pope, but what writing is referred to? The Wiki page on James mentions three books he wrote (one on witch-hunting, one on the divine right of kings, one on the rules by which a good king could rule), but I can find nothing about religious writings.
Triplici nodo, triplex cuneus, or, An Apologie for the Oath of Allegiance, both in its original 1608 edition, which was published anonymously, and in its 1609 edition, which was published under his own name and which was expanded to include his Premonition to All Most Mightie Monarches, Kings, Free Princes and States in Christendom. Both versions were his contributions to the major controversy about papal claims sparked off by the oath he had introduced in the wake of the Gunpowder Plot.