php 5.2 compatibility
formatting and basic xml parsing implementation
fixed basic parsing