Slight possible optimization for parsing xml