Don't repeat code in function parseFromXml
Merge pull request #2 from yrpen/master

ParseXML DRY by yrpen