optimize xml parser performance