Setting A Global Variable From XML

How would I go about setting a global variable that is being pulled from a xml file.

ie: <columns>4</columns>

I want to have this variable be global to use in a different function.

Thanks