Breaking XML attribute parsing into its own method