Resolve some discrepancy issues
Add matching xml function