Added method XmlElement::getChildByAttribute().
Removed some duplicated code.