As you said, the structures are different. Rather than map elements, why not just do the right thing and re-code to the new API?